diff options
author | netblue30 <netblue30@yahoo.com> | 2016-07-29 08:00:52 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-07-29 08:00:52 -0400 |
commit | 71f6f53bbf71b1c1e1be8516dcc24e3ece44cd72 (patch) | |
tree | 00224d420e9fb371d1e8d2a158600b33ad4081f1 /src | |
parent | noexec fix (diff) | |
download | firejail-71f6f53bbf71b1c1e1be8516dcc24e3ece44cd72.tar.gz firejail-71f6f53bbf71b1c1e1be8516dcc24e3ece44cd72.tar.zst firejail-71f6f53bbf71b1c1e1be8516dcc24e3ece44cd72.zip |
config file fix
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/checkcfg.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c index 6929988ae..7de491f5f 100644 --- a/src/firejail/checkcfg.c +++ b/src/firejail/checkcfg.c | |||
@@ -58,6 +58,15 @@ int checkcfg(int val) { | |||
58 | #endif | 58 | #endif |
59 | } | 59 | } |
60 | 60 | ||
61 | // if the file exists, it should be owned by root | ||
62 | struct stat s; | ||
63 | if (stat(fname, &s) == -1) | ||
64 | errExit("stat"); | ||
65 | if (s.st_uid != 0 || s.st_gid != 0) { | ||
66 | fprintf(stderr, "Error: configuration file should be owned by root\n"); | ||
67 | exit(1); | ||
68 | } | ||
69 | |||
61 | // read configuration file | 70 | // read configuration file |
62 | char buf[MAX_READ]; | 71 | char buf[MAX_READ]; |
63 | while (fgets(buf,MAX_READ, fp)) { | 72 | while (fgets(buf,MAX_READ, fp)) { |