Skip to content

Commit

Permalink
bugfix: parse --debug before using it
Browse files Browse the repository at this point in the history
The `arg_debug` flag is being set after some functions check for it,
such as `check_kernel_procs()`.
  • Loading branch information
powerjungle authored and kmk3 committed Dec 27, 2024
1 parent f27775c commit cc9c6ed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/firejail/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,13 @@ int main(int argc, char **argv, char **envp) {
if (check_arg(argc, argv, "--quiet", 1) || (env_quiet && strcmp(env_quiet, "yes") == 0))
arg_quiet = 1;

// process --debug
const char *env_debug = env_get("FIREJAIL_DEBUG");
if (check_arg(argc, argv, "--debug", 1) || (env_debug && strcmp(env_debug, "yes") == 0)) {
arg_debug = 1;
arg_quiet = 0;
}

// check if the user is allowed to use firejail
init_cfg(argc, argv);

Expand Down

0 comments on commit cc9c6ed

Please sign in to comment.