diff options
author | 2016-03-27 19:01:21 -0400 | |
---|---|---|
committer | 2016-03-27 19:01:21 -0400 | |
commit | b7bf464a53a3736a410a1d6a191e8980137e0657 (patch) | |
tree | 1bcbca5b28b3f7378d4e9478597f0f4c0705f8cd | |
parent | openbox fix (diff) | |
download | firejail-b7bf464a53a3736a410a1d6a191e8980137e0657.tar.gz firejail-b7bf464a53a3736a410a1d6a191e8980137e0657.tar.zst firejail-b7bf464a53a3736a410a1d6a191e8980137e0657.zip |
send stderr to logfile using --output
-rw-r--r-- | RELNOTES | 1 | ||||
-rw-r--r-- | src/firejail/output.c | 4 | ||||
-rw-r--r-- | src/firejail/usage.c | 4 | ||||
-rw-r--r-- | src/man/firejail.txt | 2 |
4 files changed, 6 insertions, 5 deletions
@@ -6,6 +6,7 @@ firejail (0.9.39) baseline; urgency=low | |||
6 | * added filetransfer options --ls and --get | 6 | * added filetransfer options --ls and --get |
7 | * added mkdir, ipc-namespace and nosound profile commands | 7 | * added mkdir, ipc-namespace and nosound profile commands |
8 | * --version also prints compile options | 8 | * --version also prints compile options |
9 | * --output option also redirects stderr | ||
9 | * added compile-time option to restrict --net= to root only | 10 | * added compile-time option to restrict --net= to root only |
10 | * run time config support, man firejail-config | 11 | * run time config support, man firejail-config |
11 | * added firecfg utility | 12 | * added firecfg utility |
diff --git a/src/firejail/output.c b/src/firejail/output.c index a554b76aa..269ac25ea 100644 --- a/src/firejail/output.c +++ b/src/firejail/output.c | |||
@@ -76,7 +76,7 @@ void check_output(int argc, char **argv) { | |||
76 | for (i = 0; i < argc; i++) { | 76 | for (i = 0; i < argc; i++) { |
77 | len += strlen(argv[i]) + 1; // + ' ' | 77 | len += strlen(argv[i]) + 1; // + ' ' |
78 | } | 78 | } |
79 | len += 50 + strlen(outfile); // tee command | 79 | len += 100 + strlen(LIBDIR) + strlen(outfile); // tee command |
80 | 80 | ||
81 | char *cmd = malloc(len + 1); // + '\0' | 81 | char *cmd = malloc(len + 1); // + '\0' |
82 | if (!cmd) | 82 | if (!cmd) |
@@ -88,7 +88,7 @@ void check_output(int argc, char **argv) { | |||
88 | continue; | 88 | continue; |
89 | ptr += sprintf(ptr, "%s ", argv[i]); | 89 | ptr += sprintf(ptr, "%s ", argv[i]); |
90 | } | 90 | } |
91 | sprintf(ptr, "| %s/firejail/ftee %s", LIBDIR, outfile); | 91 | sprintf(ptr, "2>&1 | %s/firejail/ftee %s", LIBDIR, outfile); |
92 | 92 | ||
93 | // run command | 93 | // run command |
94 | char *a[4]; | 94 | char *a[4]; |
diff --git a/src/firejail/usage.c b/src/firejail/usage.c index da5fd4e2f..597005128 100644 --- a/src/firejail/usage.c +++ b/src/firejail/usage.c | |||
@@ -157,8 +157,8 @@ void usage(void) { | |||
157 | #endif | 157 | #endif |
158 | printf(" --nosound - disable sound system.\n\n"); | 158 | printf(" --nosound - disable sound system.\n\n"); |
159 | 159 | ||
160 | printf(" --output=logfile - stdout logging and log rotation. Copy stdout to\n"); | 160 | printf(" --output=logfile - stdout logging and log rotation. Copy stdout and stderr\n"); |
161 | printf("\tlogfile, and keep the size of the file under 500KB using log\n"); | 161 | printf("\tto logfile, and keep the size of the file under 500KB using log\n"); |
162 | printf("\trotation. Five files with prefixes .1 to .5 are used in\n"); | 162 | printf("\trotation. Five files with prefixes .1 to .5 are used in\n"); |
163 | printf("\trotation.\n\n"); | 163 | printf("\trotation.\n\n"); |
164 | 164 | ||
diff --git a/src/man/firejail.txt b/src/man/firejail.txt index 806a68c3c..6eb7c3ff7 100644 --- a/src/man/firejail.txt +++ b/src/man/firejail.txt | |||
@@ -892,7 +892,7 @@ $ firejail \-\-nosound firefox | |||
892 | 892 | ||
893 | .TP | 893 | .TP |
894 | \fB\-\-output=logfile | 894 | \fB\-\-output=logfile |
895 | stdout logging and log rotation. Copy stdout to logfile, and keep the size of the file under 500KB using log | 895 | stdout logging and log rotation. Copy stdout and stderr to logfile, and keep the size of the file under 500KB using log |
896 | rotation. Five files with prefixes .1 to .5 are used in rotation. | 896 | rotation. Five files with prefixes .1 to .5 are used in rotation. |
897 | .br | 897 | .br |
898 | 898 | ||