diff options
author | 2016-07-31 10:06:41 -0400 | |
---|---|---|
committer | 2016-07-31 10:06:41 -0400 | |
commit | 59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab (patch) | |
tree | b8e44859848ece18a81e63afc7910d0d0a4ca544 /src | |
parent | Merge pull request #662 from reinerh/master (diff) | |
download | firejail-59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab.tar.gz firejail-59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab.tar.zst firejail-59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab.zip |
cleanup and some new tests
Diffstat (limited to 'src')
-rw-r--r-- | src/firejail/cmdline.c | 10 | ||||
-rw-r--r-- | src/firejail/firejail.h | 3 | ||||
-rw-r--r-- | src/firejail/fs_bin.c | 2 | ||||
-rw-r--r-- | src/firejail/main.c | 5 |
4 files changed, 14 insertions, 6 deletions
diff --git a/src/firejail/cmdline.c b/src/firejail/cmdline.c index 517124d9e..48cbaffb7 100644 --- a/src/firejail/cmdline.c +++ b/src/firejail/cmdline.c | |||
@@ -27,9 +27,9 @@ | |||
27 | #include <errno.h> | 27 | #include <errno.h> |
28 | 28 | ||
29 | int cmdline_length(int argc, char **argv, int index) { | 29 | int cmdline_length(int argc, char **argv, int index) { |
30 | int i,j; | 30 | unsigned i,j; |
31 | int len = 0; | 31 | int len = 0; |
32 | int argcnt = argc - index; | 32 | unsigned argcnt = argc - index; |
33 | bool in_quotes = false; | 33 | bool in_quotes = false; |
34 | 34 | ||
35 | for (i = 0; i < argcnt; i++) { | 35 | for (i = 0; i < argcnt; i++) { |
@@ -63,8 +63,8 @@ int cmdline_length(int argc, char **argv, int index) { | |||
63 | } | 63 | } |
64 | 64 | ||
65 | void quote_cmdline(char *command_line, char *window_title, int len, int argc, char **argv, int index) { | 65 | void quote_cmdline(char *command_line, char *window_title, int len, int argc, char **argv, int index) { |
66 | int i,j; | 66 | unsigned i,j; |
67 | int argcnt = argc - index; | 67 | unsigned argcnt = argc - index; |
68 | bool in_quotes = false; | 68 | bool in_quotes = false; |
69 | char *ptr1 = command_line; | 69 | char *ptr1 = command_line; |
70 | char *ptr2 = window_title; | 70 | char *ptr2 = window_title; |
@@ -127,7 +127,7 @@ void quote_cmdline(char *command_line, char *window_title, int len, int argc, ch | |||
127 | ptr2 += strlen(ptr2); | 127 | ptr2 += strlen(ptr2); |
128 | } | 128 | } |
129 | 129 | ||
130 | assert(len == strlen(command_line)); | 130 | assert((unsigned) len == strlen(command_line)); |
131 | } | 131 | } |
132 | 132 | ||
133 | void build_cmdline(char **command_line, char **window_title, int argc, char **argv, int index) { | 133 | void build_cmdline(char **command_line, char **window_title, int argc, char **argv, int index) { |
diff --git a/src/firejail/firejail.h b/src/firejail/firejail.h index 7a538327d..1546dc403 100644 --- a/src/firejail/firejail.h +++ b/src/firejail/firejail.h | |||
@@ -590,5 +590,8 @@ void appimage_set(const char *appimage_path); | |||
590 | void appimage_clear(void); | 590 | void appimage_clear(void); |
591 | const char *appimage_getdir(void); | 591 | const char *appimage_getdir(void); |
592 | 592 | ||
593 | // cmdline.c | ||
594 | void build_cmdline(char **command_line, char **window_title, int argc, char **argv, int index); | ||
595 | |||
593 | #endif | 596 | #endif |
594 | 597 | ||
diff --git a/src/firejail/fs_bin.c b/src/firejail/fs_bin.c index ac731c246..dca66888c 100644 --- a/src/firejail/fs_bin.c +++ b/src/firejail/fs_bin.c | |||
@@ -136,7 +136,7 @@ void fs_check_bin_list(void) { | |||
136 | ptr = strrchr(newlist, ','); | 136 | ptr = strrchr(newlist, ','); |
137 | assert(ptr); | 137 | assert(ptr); |
138 | *ptr = '\0'; | 138 | *ptr = '\0'; |
139 | if (notfound) | 139 | if (notfound && !arg_quiet) |
140 | fprintf(stderr, "Warning: not all executables from --private-bin list were found. The current list is %s\n", newlist); | 140 | fprintf(stderr, "Warning: not all executables from --private-bin list were found. The current list is %s\n", newlist); |
141 | 141 | ||
142 | cfg.bin_private_keep = newlist; | 142 | cfg.bin_private_keep = newlist; |
diff --git a/src/firejail/main.c b/src/firejail/main.c index e86d78ff1..d5ac7ad1d 100644 --- a/src/firejail/main.c +++ b/src/firejail/main.c | |||
@@ -704,6 +704,11 @@ static void detect_quiet(int argc, char **argv) { | |||
704 | "gzip", | 704 | "gzip", |
705 | "xz", | 705 | "xz", |
706 | "xzdec", | 706 | "xzdec", |
707 | "file", | ||
708 | "gtar", | ||
709 | "tar", | ||
710 | "unrar", | ||
711 | "unzip", | ||
707 | NULL | 712 | NULL |
708 | }; | 713 | }; |
709 | 714 | ||