X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fcoredump.c;h=db51098d9cfbb97927d66ef46a7d2042eb4d8ff0;hb=54cba0b16cdc94d5c21e8d805a4ade1255d43bc9;hp=59c6d4b716b54c31aa9ff8f954e494e0a2e42478;hpb=d89c8fdf48c7bad5816b9f2e77e8361721f22517;p=elogind.git diff --git a/src/journal/coredump.c b/src/journal/coredump.c index 59c6d4b71..db51098d9 100644 --- a/src/journal/coredump.c +++ b/src/journal/coredump.c @@ -26,8 +26,8 @@ #include #include -#include -#include +#include "systemd/sd-journal.h" +#include "systemd/sd-login.h" #include "log.h" #include "util.h" @@ -61,8 +61,8 @@ #define JOURNAL_SIZE_MAX ((size_t) (767LU*1024LU*1024LU)) /* Make sure to not make this larger than the maximum journal entry - * size. See ENTRY_SIZE_MAX in journald-native.c. */ -assert_cc(JOURNAL_SIZE_MAX <= ENTRY_SIZE_MAX); + * size. See DATA_SIZE_MAX in journald-native.c. */ +assert_cc(JOURNAL_SIZE_MAX <= DATA_SIZE_MAX); enum { INFO_PID, @@ -114,16 +114,10 @@ static int parse_config(void) { {} }; - return config_parse( - NULL, - "/etc/systemd/coredump.conf", - NULL, - "Coredump\0", - config_item_table_lookup, - (void*) items, - false, - false, - NULL); + return config_parse(NULL, "/etc/systemd/coredump.conf", NULL, + "Coredump\0", + config_item_table_lookup, items, + false, false, true, NULL); } static int fix_acl(int fd, uid_t uid) { @@ -402,9 +396,9 @@ static int save_external_coredump( fail_compressed: unlink_noerrno(tmp_compressed); } -#endif uncompressed: +#endif r = fix_permissions(fd, tmp, fn, info, uid); if (r < 0) goto fail; @@ -597,9 +591,9 @@ int main(int argc, char* argv[]) { } if (sd_pid_get_owner_uid(pid, &owner_uid) >= 0) { - asprintf(&core_owner_uid, "COREDUMP_OWNER_UID=" UID_FMT, owner_uid); - - if (core_owner_uid) + r = asprintf(&core_owner_uid, + "COREDUMP_OWNER_UID=" UID_FMT, owner_uid); + if (r > 0) IOVEC_SET_STRING(iovec[j++], core_owner_uid); }