diff options
author | 2019-08-29 21:37:46 -0500 | |
---|---|---|
committer | 2019-08-29 21:37:46 -0500 | |
commit | 9af2c14723da9a2e0559d36d37b3d480f77eeb6e (patch) | |
tree | c3ba6ebaaee4393c8ec1a1deae2d6261bc9e1dc9 /src/fbuilder | |
parent | Profile builder helper should use correct firejail binary path. (diff) | |
download | firejail-9af2c1472.tar.gz firejail-9af2c1472.tar.zst firejail-9af2c1472.zip |
Better debug handling.
Diffstat (limited to 'src/fbuilder')
-rw-r--r-- | src/fbuilder/build_profile.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/fbuilder/build_profile.c b/src/fbuilder/build_profile.c index 83fe4b188..16425dd48 100644 --- a/src/fbuilder/build_profile.c +++ b/src/fbuilder/build_profile.c | |||
@@ -110,7 +110,7 @@ void build_profile(int argc, char **argv, int index, FILE *fp) { | |||
110 | 110 | ||
111 | if (arg_debug) { | 111 | if (arg_debug) { |
112 | for (i = 0; i < len; i++) | 112 | for (i = 0; i < len; i++) |
113 | printf("\t%s\n", cmd[i]); | 113 | printf("%s%s\n", (i)?"\t":"", cmd[i]); |
114 | } | 114 | } |
115 | 115 | ||
116 | // fork and execute | 116 | // fork and execute |
@@ -130,7 +130,8 @@ void build_profile(int argc, char **argv, int index, FILE *fp) { | |||
130 | errExit("waitpid"); | 130 | errExit("waitpid"); |
131 | 131 | ||
132 | if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { | 132 | if (WIFEXITED(status) && WEXITSTATUS(status) == 0) { |
133 | printf("\n\n\n"); | 133 | if (fp == stdout) |
134 | printf("--- Built profile beings after this line ---\n"); | ||
134 | fprintf(fp, "############################################\n"); | 135 | fprintf(fp, "############################################\n"); |
135 | fprintf(fp, "# %s profile\n", argv[index]); | 136 | fprintf(fp, "# %s profile\n", argv[index]); |
136 | fprintf(fp, "############################################\n"); | 137 | fprintf(fp, "############################################\n"); |
@@ -177,9 +178,10 @@ void build_profile(int argc, char **argv, int index, FILE *fp) { | |||
177 | fprintf(fp, "### environment\n"); | 178 | fprintf(fp, "### environment\n"); |
178 | fprintf(fp, "shell none\n"); | 179 | fprintf(fp, "shell none\n"); |
179 | 180 | ||
180 | unlink(trace_output); | 181 | if (!arg_debug) { |
181 | unlink(strace_output); | 182 | unlink(trace_output); |
182 | 183 | unlink(strace_output); | |
184 | } | ||
183 | } | 185 | } |
184 | else { | 186 | else { |
185 | fprintf(stderr, "Error: cannot run the sandbox\n"); | 187 | fprintf(stderr, "Error: cannot run the sandbox\n"); |