From ca979697ae0c806f9af521696daa6e43e450e036 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 13 Dec 2016 19:35:12 -0500 Subject: borken - configuration file should be owned by root --- src/firejail/checkcfg.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src') 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) { cfg_val[CFG_FIREJAIL_PROMPT] = 0; // disabled by default // open configuration file - char *fname; - if (asprintf(&fname, "%s/firejail.config", SYSCONFDIR) == -1) - errExit("asprintf"); - + const char *fname = SYSCONFDIR "/firejail.config"; fp = fopen(fname, "r"); if (!fp) { #ifdef HAVE_GLOBALCFG @@ -61,15 +58,6 @@ int checkcfg(int val) { #endif } - // if the file exists, it should be owned by root - struct stat s; - if (stat(fname, &s) == -1) - errExit("stat"); - if (s.st_uid != 0) { - fprintf(stderr, "Error: configuration file should be owned by root\n"); - exit(1); - } - // read configuration file char buf[MAX_READ]; while (fgets(buf,MAX_READ, fp)) { @@ -290,7 +278,6 @@ int checkcfg(int val) { } fclose(fp); - free(fname); initialized = 1; } @@ -324,10 +311,6 @@ void print_compiletime_support(void) { #endif ); - - - - printf("\t- bind support is %s\n", #ifdef HAVE_BIND "enabled" -- cgit v1.2.3-54-g00ecf