aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-12-13 19:35:12 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-12-13 19:35:12 -0500
commitca979697ae0c806f9af521696daa6e43e450e036 (patch)
tree1ada8ed463a2c1801f2a02ba10ad25e14672396d /src
parentallusers manpage fix (diff)
downloadfirejail-ca979697ae0c806f9af521696daa6e43e450e036.tar.gz
firejail-ca979697ae0c806f9af521696daa6e43e450e036.tar.zst
firejail-ca979697ae0c806f9af521696daa6e43e450e036.zip
borken - configuration file should be owned by root
Diffstat (limited to 'src')
-rw-r--r--src/firejail/checkcfg.c19
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"