diff options
author | 2016-08-03 07:37:04 -0400 | |
---|---|---|
committer | 2016-08-03 07:37:04 -0400 | |
commit | e1b33b552f7915f2a7fa407fc50e09fde143b2d4 (patch) | |
tree | 93d3134d980759fa349bc0a8fe202de6c6012329 /src | |
parent | added /usr/games and /usr/local/games to private-bin default list (diff) | |
download | firejail-e1b33b552f7915f2a7fa407fc50e09fde143b2d4.tar.gz firejail-e1b33b552f7915f2a7fa407fc50e09fde143b2d4.tar.zst firejail-e1b33b552f7915f2a7fa407fc50e09fde143b2d4.zip |
firecfg fix
Diffstat (limited to 'src')
-rw-r--r-- | src/firecfg/main.c | 10 | ||||
-rw-r--r-- | src/man/firecfg.txt | 3 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/firecfg/main.c b/src/firecfg/main.c index f0f2aaeb7..30064de40 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"); |
@@ -206,8 +208,10 @@ static void set_file(const char *name, const char *firejail_exec) { | |||
206 | errExit("asprintf"); | 208 | errExit("asprintf"); |
207 | 209 | ||
208 | struct stat s; | 210 | struct stat s; |
209 | if (stat(fname, &s) == 0) | 211 | if (stat(fname, &s) == 0) { |
210 | ; //printf("%s already present\n", fname); | 212 | if (arg_debug) |
213 | printf("%s is already present in /usr/local/bin directory, skipping...\n", fname); | ||
214 | } | ||
211 | else { | 215 | else { |
212 | int rv = symlink(firejail_exec, fname); | 216 | int rv = symlink(firejail_exec, fname); |
213 | if (rv) { | 217 | if (rv) { |
@@ -289,6 +293,8 @@ int main(int argc, char **argv) { | |||
289 | usage(); | 293 | usage(); |
290 | return 0; | 294 | return 0; |
291 | } | 295 | } |
296 | else if (strcmp(argv[i], "--debug") == 0) | ||
297 | arg_debug = 1; | ||
292 | else if (strcmp(argv[i], "--version") == 0) { | 298 | else if (strcmp(argv[i], "--version") == 0) { |
293 | printf("firecfg version %s\n\n", VERSION); | 299 | printf("firecfg version %s\n\n", VERSION); |
294 | return 0; | 300 | return 0; |
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 |