Skip to content

Commit f246be1

Browse files
committed
bugfix: make checkcfg init/cfg vars global
Instead of them being local to the translation unit. This should ensure that firejail.config is not read more than once (as is intended by the code), especially after options like `private-etc` are applied (which could render the file inaccessible when calling `checkcfg()`). Related commits: * 8bff773 ("add symlink resolution for home directories", 2019-07-09) / issue #2877 * d325099 ("rewrite/partial revert of 8bff773", 2019-08-09) / issue #2877 * d1aeeb4 ("feature: add arg-max-count and arg-max-len options to firejail.config (#6878)", 2025-10-30) Relates to #2877 #6966.
1 parent a2283e3 commit f246be1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/firejail/checkcfg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
#define MAX_READ 8192 // line buffer for profile files
2828

29-
static int firejail_config_init = 0;
30-
static int cfg_val[CFG_MAX];
29+
int firejail_config_init = 0;
30+
int cfg_val[CFG_MAX];
3131
char *xephyr_screen = "800x600";
3232
char *xephyr_extra_params = "";
3333
char *xpra_extra_params = "";

src/firejail/firejail.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,8 @@ enum {
869869
CFG_TRACELOG,
870870
CFG_MAX // this should always be the last entry
871871
};
872+
extern int firejail_config_init;
873+
extern int cfg_val[CFG_MAX];
872874
extern char *xephyr_screen;
873875
extern char *xephyr_extra_params;
874876
extern char *xpra_extra_params;

0 commit comments

Comments
 (0)