Merge pull request #2694 from laomaiweng/propagate-quiet

Propagate --quiet to children Firejail'ed processes
This commit is contained in:
netblue30 2019-05-17 10:34:53 -05:00 committed by GitHub
commit e23fd7fc09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -160,6 +160,11 @@ void env_defaults(void) {
// set the window title
if (!arg_quiet)
printf("\033]0;firejail %s\007", cfg.window_title);
// pass --quiet as an environment variable, in case the command calls further firejailed commands
if (arg_quiet)
setenv("FIREJAIL_QUIET", "yes", 1);
fflush(0);
}

View file

@ -907,7 +907,8 @@ int main(int argc, char **argv) {
// get starting timestamp, process --quiet
start_timestamp = getticks();
if (check_arg(argc, argv, "--quiet", 1))
char *env_quiet = getenv("FIREJAIL_QUIET");
if (check_arg(argc, argv, "--quiet", 1) || (env_quiet && strcmp(env_quiet, "yes") == 0))
arg_quiet = 1;
// cleanup at exit