diff options
author | 2016-02-15 07:56:12 -0500 | |
---|---|---|
committer | 2016-02-15 07:56:12 -0500 | |
commit | 4846489b89bfb37eab6cb86e95e5162a22f77116 (patch) | |
tree | d549fbddc35ad90c1100bb7bd1df8a36b494f0fb /src | |
parent | manpage fix (diff) | |
download | firejail-4846489b89bfb37eab6cb86e95e5162a22f77116.tar.gz firejail-4846489b89bfb37eab6cb86e95e5162a22f77116.tar.zst firejail-4846489b89bfb37eab6cb86e95e5162a22f77116.zip |
centos6 fix
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/firejail.h | 1 | ||||
-rw-r--r-- | src/firejail/fs.c | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h index feb6854fc..19c8c5eb5 100644 --- a/src/firejail/firejail.h +++ b/src/firejail/firejail.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "../include/common.h" | 22 | #include "../include/common.h" |
23 | 23 | ||
24 | // filesystem | 24 | // filesystem |
25 | #define RUN_FIREJAIL_BASEDIR "/run" | ||
25 | #define RUN_FIREJAIL_DIR "/run/firejail" | 26 | #define RUN_FIREJAIL_DIR "/run/firejail" |
26 | #define RUN_NETWORK_LOCK_FILE "/run/firejail/firejail.lock" | 27 | #define RUN_NETWORK_LOCK_FILE "/run/firejail/firejail.lock" |
27 | #define RUN_RO_DIR "/run/firejail/firejail.ro.dir" | 28 | #define RUN_RO_DIR "/run/firejail/firejail.ro.dir" |
diff --git a/src/firejail/fs.c b/src/firejail/fs.c index fa212bbd5..a43ed3134 100644 --- a/src/firejail/fs.c +++ b/src/firejail/fs.c | |||
@@ -60,6 +60,20 @@ static void create_empty_file(void) { | |||
60 | void fs_build_firejail_dir(void) { | 60 | void fs_build_firejail_dir(void) { |
61 | struct stat s; | 61 | struct stat s; |
62 | 62 | ||
63 | // CentOS 6 doesn't have /run directory | ||
64 | if (stat(RUN_FIREJAIL_BASEDIR, &s)) { | ||
65 | if (arg_debug) | ||
66 | printf("Creating %s directory\n", RUN_FIREJAIL_BASEDIR); | ||
67 | /* coverity[toctou] */ | ||
68 | int rv = mkdir(RUN_FIREJAIL_BASEDIR, 0755); | ||
69 | if (rv == -1) | ||
70 | errExit("mkdir"); | ||
71 | if (chown(RUN_FIREJAIL_BASEDIR, 0, 0) < 0) | ||
72 | errExit("chown"); | ||
73 | if (chmod(RUN_FIREJAIL_BASEDIR, 0755) < 0) | ||
74 | errExit("chmod"); | ||
75 | } | ||
76 | |||
63 | if (stat(RUN_FIREJAIL_DIR, &s)) { | 77 | if (stat(RUN_FIREJAIL_DIR, &s)) { |
64 | if (arg_debug) | 78 | if (arg_debug) |
65 | printf("Creating %s directory\n", RUN_FIREJAIL_DIR); | 79 | printf("Creating %s directory\n", RUN_FIREJAIL_DIR); |