diff options
author | 2021-05-29 12:55:12 -0400 | |
---|---|---|
committer | 2021-05-29 12:55:12 -0400 | |
commit | 0105ac513d8d66fdd60c48a358b637e7f5a1ddc8 (patch) | |
tree | fcde7785d4a8ce8939ea871fd86bd02543225f93 /src | |
parent | disable home dir whitelists when --private is present (diff) | |
download | firejail-0105ac513d8d66fdd60c48a358b637e7f5a1ddc8.tar.gz firejail-0105ac513d8d66fdd60c48a358b637e7f5a1ddc8.tar.zst firejail-0105ac513d8d66fdd60c48a358b637e7f5a1ddc8.zip |
fix crash during --shutdonw
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/shutdown.c | 6 | ||||
-rw-r--r-- | src/firejail/util.c | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/firejail/shutdown.c b/src/firejail/shutdown.c index fbfe1765b..d1be6eed4 100644 --- a/src/firejail/shutdown.c +++ b/src/firejail/shutdown.c | |||
@@ -36,8 +36,10 @@ void shut(pid_t pid) { | |||
36 | } | 36 | } |
37 | free(comm); | 37 | free(comm); |
38 | } | 38 | } |
39 | else | 39 | else { |
40 | errExit("/proc/PID/comm"); | 40 | fprintf(stderr, "Error: cannot find process %d\n", pid); |
41 | exit(1); | ||
42 | } | ||
41 | 43 | ||
42 | // check privileges for non-root users | 44 | // check privileges for non-root users |
43 | uid_t uid = getuid(); | 45 | uid_t uid = getuid(); |
diff --git a/src/firejail/util.c b/src/firejail/util.c index b15b719b7..6a7318c4b 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c | |||
@@ -647,9 +647,11 @@ int find_child(pid_t parent, pid_t *child) { | |||
647 | if (parent == atoi(ptr)) { | 647 | if (parent == atoi(ptr)) { |
648 | // we don't want /usr/bin/xdg-dbus-proxy! | 648 | // we don't want /usr/bin/xdg-dbus-proxy! |
649 | char *cmdline = pid_proc_cmdline(pid); | 649 | char *cmdline = pid_proc_cmdline(pid); |
650 | if (strncmp(cmdline, XDG_DBUS_PROXY_PATH, strlen(XDG_DBUS_PROXY_PATH)) != 0) | 650 | if (cmdline) { |
651 | *child = pid; | 651 | if (strncmp(cmdline, XDG_DBUS_PROXY_PATH, strlen(XDG_DBUS_PROXY_PATH)) != 0) |
652 | free(cmdline); | 652 | *child = pid; |
653 | free(cmdline); | ||
654 | } | ||
653 | } | 655 | } |
654 | break; // stop reading the file | 656 | break; // stop reading the file |
655 | } | 657 | } |