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=cd612b7ebca80087189d19ae902859f83d91bed2;hpb=e9f3d2d508bfd9fb5b54e82994bda365a71eb864;p=elogind.git diff --git a/src/journal/coredump.c b/src/journal/coredump.c index cd612b7eb..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, - 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) { @@ -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); }