summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-06-23 15:53:03 +0200
committerLennart Poettering <lennart@poettering.net>2014-06-23 15:53:03 +0200
commit6388c31525eff90aadddad448217fa92232890ca (patch)
treeab5c19ec09fac5dbfe697b69aee321216b9de653 /src
parent4b8cbe9a71380a912b799de5f12f06a9d838b289 (diff)
coredump: quit early if we cannot store ay coredump to disk
Diffstat (limited to 'src')
-rw-r--r--src/journal/coredump.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/journal/coredump.c b/src/journal/coredump.c
index 287e0ed7fd..764c5e72ab 100644
--- a/src/journal/coredump.c
+++ b/src/journal/coredump.c
@@ -39,6 +39,7 @@
#include "conf-parser.h"
#include "copy.h"
#include "stacktrace.h"
+#include "path-util.h"
#ifdef HAVE_ACL
#include <sys/acl.h>
@@ -375,6 +376,13 @@ int main(int argc, char* argv[]) {
parse_config();
log_debug("Selected storage '%s'.", coredump_storage_to_string(arg_storage));
+ /* Exit early if we cannot write the coredump to disk anyway */
+ if (path_is_read_only_fs("/var/lib") != 0) {
+ log_error("Coredump directory not mounted or not writable, skipping coredump.");
+ r = -EROFS;
+ goto finish;
+ }
+
r = parse_uid(argv[ARG_UID], &uid);
if (r < 0) {
log_error("Failed to parse UID.");