diff options
author | netblue30 <netblue30@yahoo.com> | 2015-10-19 14:46:24 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-10-19 14:46:24 -0400 |
commit | 0021c29f7f25a5020091182c690407a753f933e4 (patch) | |
tree | 3f3eb4172c96cc6f92ddfa636053d19c7e55f1ab /src/firejail/shutdown.c | |
parent | testing (diff) | |
download | firejail-0021c29f7f25a5020091182c690407a753f933e4.tar.gz firejail-0021c29f7f25a5020091182c690407a753f933e4.tar.zst firejail-0021c29f7f25a5020091182c690407a753f933e4.zip |
fixed join/shutdown problem, moving browsers and mail clients to a --shell=none default in profile files
Diffstat (limited to 'src/firejail/shutdown.c')
-rw-r--r-- | src/firejail/shutdown.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/firejail/shutdown.c b/src/firejail/shutdown.c index f37869bd0..649f86800 100644 --- a/src/firejail/shutdown.c +++ b/src/firejail/shutdown.c | |||
@@ -60,13 +60,8 @@ void shut(pid_t pid) { | |||
60 | // check privileges for non-root users | 60 | // check privileges for non-root users |
61 | uid_t uid = getuid(); | 61 | uid_t uid = getuid(); |
62 | if (uid != 0) { | 62 | if (uid != 0) { |
63 | struct stat s; | 63 | uid_t sandbox_uid = pid_get_uid(pid); |
64 | char *dir; | 64 | if (uid != sandbox_uid) { |
65 | if (asprintf(&dir, "/proc/%u/ns", pid) == -1) | ||
66 | errExit("asprintf"); | ||
67 | if (stat(dir, &s) < 0) | ||
68 | errExit("stat"); | ||
69 | if (s.st_uid != uid) { | ||
70 | fprintf(stderr, "Error: permission is denied to shutdown a sandbox created by a different user.\n"); | 65 | fprintf(stderr, "Error: permission is denied to shutdown a sandbox created by a different user.\n"); |
71 | exit(1); | 66 | exit(1); |
72 | } | 67 | } |