diff options
author | 2019-07-14 11:51:44 +0200 | |
---|---|---|
committer | 2019-07-14 11:51:44 +0200 | |
commit | bfb0cfea514cd340233d9f5d92ea1f3edc0e24b7 (patch) | |
tree | c572a228185547929d2ea9dab3eb79d3dd55f6a4 | |
parent | Merge pull request #2858 from veloute/sn-fix (diff) | |
download | firejail-bfb0cfea514cd340233d9f5d92ea1f3edc0e24b7.tar.gz firejail-bfb0cfea514cd340233d9f5d92ea1f3edc0e24b7.tar.zst firejail-bfb0cfea514cd340233d9f5d92ea1f3edc0e24b7.zip |
don't allow root directory as home
-rw-r--r-- | src/firejail/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c index d00147c74..950146612 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -262,7 +262,7 @@ static int has_link(const char *dir) { | |||
262 | static void build_cfg_homedir(const char *dir) { | 262 | static void build_cfg_homedir(const char *dir) { |
263 | EUID_ASSERT(); | 263 | EUID_ASSERT(); |
264 | assert(dir); | 264 | assert(dir); |
265 | if (dir[0] != '/') { | 265 | if (dir[0] != '/' || dir[1] == '\0') { // system users sometimes have root directory as home |
266 | fprintf(stderr, "Error: invalid user directory \"%s\"\n", dir); | 266 | fprintf(stderr, "Error: invalid user directory \"%s\"\n", dir); |
267 | exit(1); | 267 | exit(1); |
268 | } | 268 | } |