diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/firecfg/main.c | 16 | ||||
-rw-r--r-- | src/firejail/fs_bin.c | 5 | ||||
-rw-r--r-- | src/firejail/sandbox.c | 10 | ||||
-rw-r--r-- | src/man/firecfg.txt | 3 |
4 files changed, 24 insertions, 10 deletions
diff --git a/src/firecfg/main.c b/src/firecfg/main.c index f0f2aaeb7..9c7c49e1d 100644 --- a/src/firecfg/main.c +++ b/src/firecfg/main.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <sys/stat.h> | 26 | #include <sys/stat.h> |
27 | #include <unistd.h> | 27 | #include <unistd.h> |
28 | #include "../include/common.h" | 28 | #include "../include/common.h" |
29 | static int arg_debug = 0; | ||
29 | 30 | ||
30 | static void usage(void) { | 31 | static void usage(void) { |
31 | printf("firecfg - version %s\n\n", VERSION); | 32 | printf("firecfg - version %s\n\n", VERSION); |
@@ -37,6 +38,7 @@ static void usage(void) { | |||
37 | printf("DESKTOP INTEGRATION section in man 1 firejail.\n\n"); | 38 | printf("DESKTOP INTEGRATION section in man 1 firejail.\n\n"); |
38 | printf("Usage: firecfg [OPTIONS]\n\n"); | 39 | printf("Usage: firecfg [OPTIONS]\n\n"); |
39 | printf(" --clean - remove all firejail symbolic links.\n\n"); | 40 | printf(" --clean - remove all firejail symbolic links.\n\n"); |
41 | printf(" --debug - print debug messages.\n\n"); | ||
40 | printf(" --help, -? - this help screen.\n\n"); | 42 | printf(" --help, -? - this help screen.\n\n"); |
41 | printf(" --list - list all firejail symbolic links.\n\n"); | 43 | printf(" --list - list all firejail symbolic links.\n\n"); |
42 | printf(" --version - print program version and exit.\n\n"); | 44 | printf(" --version - print program version and exit.\n\n"); |
@@ -67,9 +69,12 @@ static int find(const char *program, const char *directory) { | |||
67 | errExit("asprintf"); | 69 | errExit("asprintf"); |
68 | 70 | ||
69 | struct stat s; | 71 | struct stat s; |
70 | if (stat(fname, &s) == 0) | 72 | if (stat(fname, &s) == 0) { |
73 | if (arg_debug) | ||
74 | printf("found %s in directory %s\n", program, directory); | ||
71 | retval = 1; | 75 | retval = 1; |
72 | 76 | } | |
77 | |||
73 | free(fname); | 78 | free(fname); |
74 | return retval; | 79 | return retval; |
75 | } | 80 | } |
@@ -206,8 +211,9 @@ static void set_file(const char *name, const char *firejail_exec) { | |||
206 | errExit("asprintf"); | 211 | errExit("asprintf"); |
207 | 212 | ||
208 | struct stat s; | 213 | struct stat s; |
209 | if (stat(fname, &s) == 0) | 214 | if (stat(fname, &s) == 0) { |
210 | ; //printf("%s already present\n", fname); | 215 | printf("%s is already present, skipping...\n", fname); |
216 | } | ||
211 | else { | 217 | else { |
212 | int rv = symlink(firejail_exec, fname); | 218 | int rv = symlink(firejail_exec, fname); |
213 | if (rv) { | 219 | if (rv) { |
@@ -289,6 +295,8 @@ int main(int argc, char **argv) { | |||
289 | usage(); | 295 | usage(); |
290 | return 0; | 296 | return 0; |
291 | } | 297 | } |
298 | else if (strcmp(argv[i], "--debug") == 0) | ||
299 | arg_debug = 1; | ||
292 | else if (strcmp(argv[i], "--version") == 0) { | 300 | else if (strcmp(argv[i], "--version") == 0) { |
293 | printf("firecfg version %s\n\n", VERSION); | 301 | printf("firecfg version %s\n\n", VERSION); |
294 | return 0; | 302 | return 0; |
diff --git a/src/firejail/fs_bin.c b/src/firejail/fs_bin.c index dca66888c..cc2aa8f4d 100644 --- a/src/firejail/fs_bin.c +++ b/src/firejail/fs_bin.c | |||
@@ -28,6 +28,8 @@ static char *paths[] = { | |||
28 | "/usr/local/bin", | 28 | "/usr/local/bin", |
29 | "/usr/bin", | 29 | "/usr/bin", |
30 | "/bin", | 30 | "/bin", |
31 | "/usr/games", | ||
32 | "/usr/local/games", | ||
31 | "/usr/local/sbin", | 33 | "/usr/local/sbin", |
32 | "/usr/sbin", | 34 | "/usr/sbin", |
33 | "/sbin", | 35 | "/sbin", |
@@ -76,7 +78,8 @@ static char *check_dir_or_file(const char *name) { | |||
76 | } | 78 | } |
77 | 79 | ||
78 | if (!fname) { | 80 | if (!fname) { |
79 | // fprintf(stderr, "Warning: file %s not found\n", name); | 81 | if (arg_debug) |
82 | fprintf(stderr, "Warning: file %s not found\n", name); | ||
80 | return NULL; | 83 | return NULL; |
81 | } | 84 | } |
82 | 85 | ||
diff --git a/src/firejail/sandbox.c b/src/firejail/sandbox.c index d9866385e..f37605e20 100644 --- a/src/firejail/sandbox.c +++ b/src/firejail/sandbox.c | |||
@@ -541,6 +541,11 @@ int sandbox(void* sandbox_arg) { | |||
541 | fs_private_tmp(); | 541 | fs_private_tmp(); |
542 | 542 | ||
543 | //**************************** | 543 | //**************************** |
544 | // update /proc, /sys, /dev, /boot directorymy | ||
545 | //**************************** | ||
546 | fs_proc_sys_dev_boot(); | ||
547 | |||
548 | //**************************** | ||
544 | // apply the profile file | 549 | // apply the profile file |
545 | //**************************** | 550 | //**************************** |
546 | if (cfg.profile) { | 551 | if (cfg.profile) { |
@@ -558,11 +563,6 @@ int sandbox(void* sandbox_arg) { | |||
558 | fs_trace(); | 563 | fs_trace(); |
559 | 564 | ||
560 | //**************************** | 565 | //**************************** |
561 | // update /proc, /dev, /boot directorymy | ||
562 | //**************************** | ||
563 | fs_proc_sys_dev_boot(); | ||
564 | |||
565 | //**************************** | ||
566 | // --nosound and fix for pulseaudio 7.0 | 566 | // --nosound and fix for pulseaudio 7.0 |
567 | //**************************** | 567 | //**************************** |
568 | if (arg_nosound) { | 568 | if (arg_nosound) { |
diff --git a/src/man/firecfg.txt b/src/man/firecfg.txt index c12bf7731..9458c4b67 100644 --- a/src/man/firecfg.txt +++ b/src/man/firecfg.txt | |||
@@ -17,6 +17,9 @@ The symbolic links are placed in /usr/local/bin. For more information, see | |||
17 | \fB\-\-clean | 17 | \fB\-\-clean |
18 | Remove all firejail symbolic links. | 18 | Remove all firejail symbolic links. |
19 | .TP | 19 | .TP |
20 | \fB\-\-debug | ||
21 | Print debug messages. | ||
22 | .TP | ||
20 | \fB\-?\fR, \fB\-\-help\fR | 23 | \fB\-?\fR, \fB\-\-help\fR |
21 | Print options end exit. | 24 | Print options end exit. |
22 | .TP | 25 | .TP |