diff options
-rw-r--r-- | src/firejail/checkcfg.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/firejail/checkcfg.c b/src/firejail/checkcfg.c index 098e8e967..c3eedc510 100644 --- a/src/firejail/checkcfg.c +++ b/src/firejail/checkcfg.c | |||
@@ -46,10 +46,7 @@ int checkcfg(int val) { | |||
46 | cfg_val[CFG_FIREJAIL_PROMPT] = 0; // disabled by default | 46 | cfg_val[CFG_FIREJAIL_PROMPT] = 0; // disabled by default |
47 | 47 | ||
48 | // open configuration file | 48 | // open configuration file |
49 | char *fname; | 49 | const char *fname = SYSCONFDIR "/firejail.config"; |
50 | if (asprintf(&fname, "%s/firejail.config", SYSCONFDIR) == -1) | ||
51 | errExit("asprintf"); | ||
52 | |||
53 | fp = fopen(fname, "r"); | 50 | fp = fopen(fname, "r"); |
54 | if (!fp) { | 51 | if (!fp) { |
55 | #ifdef HAVE_GLOBALCFG | 52 | #ifdef HAVE_GLOBALCFG |
@@ -61,15 +58,6 @@ int checkcfg(int val) { | |||
61 | #endif | 58 | #endif |
62 | } | 59 | } |
63 | 60 | ||
64 | // if the file exists, it should be owned by root | ||
65 | struct stat s; | ||
66 | if (stat(fname, &s) == -1) | ||
67 | errExit("stat"); | ||
68 | if (s.st_uid != 0) { | ||
69 | fprintf(stderr, "Error: configuration file should be owned by root\n"); | ||
70 | exit(1); | ||
71 | } | ||
72 | |||
73 | // read configuration file | 61 | // read configuration file |
74 | char buf[MAX_READ]; | 62 | char buf[MAX_READ]; |
75 | while (fgets(buf,MAX_READ, fp)) { | 63 | while (fgets(buf,MAX_READ, fp)) { |
@@ -290,7 +278,6 @@ int checkcfg(int val) { | |||
290 | } | 278 | } |
291 | 279 | ||
292 | fclose(fp); | 280 | fclose(fp); |
293 | free(fname); | ||
294 | initialized = 1; | 281 | initialized = 1; |
295 | } | 282 | } |
296 | 283 | ||
@@ -324,10 +311,6 @@ void print_compiletime_support(void) { | |||
324 | #endif | 311 | #endif |
325 | ); | 312 | ); |
326 | 313 | ||
327 | |||
328 | |||
329 | |||
330 | |||
331 | printf("\t- bind support is %s\n", | 314 | printf("\t- bind support is %s\n", |
332 | #ifdef HAVE_BIND | 315 | #ifdef HAVE_BIND |
333 | "enabled" | 316 | "enabled" |