X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fcoredump.c;h=d322e7984c51d51a0004a4cfba2154a37ab50c88;hb=56e6c2abb8f18bba2bb9d96d66ac7e633349ddfb;hp=be45a684e5aadc8f6592b50911ab38daca6c74dd;hpb=301af7e4853ad0281402f8d86f5a77c6cb7ce9f4;p=elogind.git diff --git a/src/journal/coredump.c b/src/journal/coredump.c index be45a684e..d322e7984 100644 --- a/src/journal/coredump.c +++ b/src/journal/coredump.c @@ -49,11 +49,7 @@ #include "path-util.h" #include "compress.h" #include "coredump-vacuum.h" - -#ifdef HAVE_ACL -# include -# include "acl-util.h" -#endif +#include "acl-util.h" /* The maximum size up to which we process coredumps */ #define PROCESS_SIZE_MAX ((off_t) (2LLU*1024LLU*1024LLU*1024LLU)) @@ -306,9 +302,9 @@ static int save_external_coredump( if (r < 0) return log_error_errno(r, "Failed to determine coredump file name: %m"); - tmp = tempfn_random(fn); - if (!tmp) - return log_oom(); + r = tempfn_random(fn, &tmp); + if (r < 0) + return log_error_errno(r, "Failed to determine temporary file name: %m"); mkdir_p_label("/var/lib/systemd/coredump", 0755); @@ -316,7 +312,7 @@ static int save_external_coredump( if (fd < 0) return log_error_errno(errno, "Failed to create coredump file %s: %m", tmp); - r = copy_bytes(STDIN_FILENO, fd, arg_process_size_max); + r = copy_bytes(STDIN_FILENO, fd, arg_process_size_max, false); if (r == -EFBIG) { log_error("Coredump of %s (%s) is larger than configured processing limit, refusing.", info[INFO_PID], info[INFO_COMM]); goto fail; @@ -352,9 +348,9 @@ static int save_external_coredump( goto uncompressed; } - tmp_compressed = tempfn_random(fn_compressed); - if (!tmp_compressed) { - log_oom(); + r = tempfn_random(fn_compressed, &tmp_compressed); + if (r < 0) { + log_error_errno(r, "Failed to determine temporary file name for %s: %m", fn_compressed); goto uncompressed; }