mirror of
https://github.com/systemd/systemd.git
synced 2024-11-02 10:51:20 +03:00
coredump: quit early if we cannot store ay coredump to disk
This commit is contained in:
parent
4b8cbe9a71
commit
6388c31525
@ -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.");
|
||||
|
Loading…
Reference in New Issue
Block a user