mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-21 06:45:29 -06:00
centos6 fix
This commit is contained in:
parent
5d95c181b9
commit
4846489b89
2 changed files with 15 additions and 0 deletions
|
|
@ -22,6 +22,7 @@
|
|||
#include "../include/common.h"
|
||||
|
||||
// filesystem
|
||||
#define RUN_FIREJAIL_BASEDIR "/run"
|
||||
#define RUN_FIREJAIL_DIR "/run/firejail"
|
||||
#define RUN_NETWORK_LOCK_FILE "/run/firejail/firejail.lock"
|
||||
#define RUN_RO_DIR "/run/firejail/firejail.ro.dir"
|
||||
|
|
|
|||
|
|
@ -60,6 +60,20 @@ static void create_empty_file(void) {
|
|||
void fs_build_firejail_dir(void) {
|
||||
struct stat s;
|
||||
|
||||
// CentOS 6 doesn't have /run directory
|
||||
if (stat(RUN_FIREJAIL_BASEDIR, &s)) {
|
||||
if (arg_debug)
|
||||
printf("Creating %s directory\n", RUN_FIREJAIL_BASEDIR);
|
||||
/* coverity[toctou] */
|
||||
int rv = mkdir(RUN_FIREJAIL_BASEDIR, 0755);
|
||||
if (rv == -1)
|
||||
errExit("mkdir");
|
||||
if (chown(RUN_FIREJAIL_BASEDIR, 0, 0) < 0)
|
||||
errExit("chown");
|
||||
if (chmod(RUN_FIREJAIL_BASEDIR, 0755) < 0)
|
||||
errExit("chmod");
|
||||
}
|
||||
|
||||
if (stat(RUN_FIREJAIL_DIR, &s)) {
|
||||
if (arg_debug)
|
||||
printf("Creating %s directory\n", RUN_FIREJAIL_DIR);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue