aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/firejail/main.c34
-rw-r--r--src/firejail/profile.c14
-rw-r--r--src/man/firejail-profile.txt8
3 files changed, 19 insertions, 37 deletions
diff --git a/src/firejail/main.c b/src/firejail/main.c
index d5ac7ad1d..8bb438ba4 100644
--- a/src/firejail/main.c
+++ b/src/firejail/main.c
@@ -697,20 +697,6 @@ static void delete_x11_file(pid_t pid) {
697 697
698static void detect_quiet(int argc, char **argv) { 698static void detect_quiet(int argc, char **argv) {
699 int i; 699 int i;
700 char *progs[] = {
701 "less",
702 "cpio",
703 "strings",
704 "gzip",
705 "xz",
706 "xzdec",
707 "file",
708 "gtar",
709 "tar",
710 "unrar",
711 "unzip",
712 NULL
713 };
714 700
715 // detect --quiet 701 // detect --quiet
716 for (i = 1; i < argc; i++) { 702 for (i = 1; i < argc; i++) {
@@ -725,26 +711,6 @@ static void detect_quiet(int argc, char **argv) {
725 if (strncmp(argv[i], "--", 2) != 0) 711 if (strncmp(argv[i], "--", 2) != 0)
726 break; 712 break;
727 } 713 }
728
729 // argv[i] is the program name if --quiet was not already detected
730 if (arg_quiet || i == argc)
731 return;
732
733 // extract the name of the program without the leading path
734 char *ptr = strrchr(argv[i], '/');
735 char *name = (ptr)? (ptr + 1): argv[i];
736 if (*name == '\0')
737 return;
738
739 // look for the program in the list
740 int j = 0;
741 while (progs[j] != NULL) {
742 if (strcmp(name, progs[j]) == 0) {
743 arg_quiet = 1;
744 return;
745 }
746 j++;
747 }
748} 714}
749 715
750//******************************************* 716//*******************************************
diff --git a/src/firejail/profile.c b/src/firejail/profile.c
index 46ef0921d..8c2970639 100644
--- a/src/firejail/profile.c
+++ b/src/firejail/profile.c
@@ -817,8 +817,7 @@ void profile_read(const char *fname) {
817 exit(1); 817 exit(1);
818 } 818 }
819 819
820 if (!arg_quiet) 820 int msg_printed = 0;
821 fprintf(stderr, "Reading profile %s\n", fname);
822 821
823 // read the file line by line 822 // read the file line by line
824 char buf[MAX_READ + 1]; 823 char buf[MAX_READ + 1];
@@ -836,6 +835,17 @@ void profile_read(const char *fname) {
836 continue; 835 continue;
837 } 836 }
838 837
838 // process quiet
839 if (strcmp(ptr, "quiet") == 0) {
840 arg_quiet = 1;
841 continue;
842 }
843 if (!msg_printed) {
844 if (!arg_quiet)
845 fprintf(stderr, "Reading profile %s\n", fname);
846 msg_printed = 1;
847 }
848
839 // process include 849 // process include
840 if (strncmp(ptr, "include ", 8) == 0) { 850 if (strncmp(ptr, "include ", 8) == 0) {
841 include_level++; 851 include_level++;
diff --git a/src/man/firejail-profile.txt b/src/man/firejail-profile.txt
index 7e33a6b45..b6908dd00 100644
--- a/src/man/firejail-profile.txt
+++ b/src/man/firejail-profile.txt
@@ -93,11 +93,17 @@ If the file name matches file_name, the file will not be blacklisted in any blac
93Example: "noblacklist ${HOME}/.mozilla" 93Example: "noblacklist ${HOME}/.mozilla"
94 94
95.TP 95.TP
96\fBignore command 96\fBignore
97Ignore command. 97Ignore command.
98 98
99Example: "ignore seccomp" 99Example: "ignore seccomp"
100 100
101.TP
102\fBquiet
103Disable Firejail's output. This should be the first uncommented command in the profile file.
104
105Example: "quiet"
106
101.SH Filesystem 107.SH Filesystem
102These profile entries define a chroot filesystem built on top of the existing 108These profile entries define a chroot filesystem built on top of the existing
103host filesystem. Each line describes a file element that is removed from 109host filesystem. Each line describes a file element that is removed from