1 |
commit: 018f85d5c9f3e268b9dee96c022a66ff697042dc |
2 |
Author: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Nov 5 09:32:06 2021 +0000 |
4 |
Commit: Mike Frysinger <vapier <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Nov 5 09:32:06 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=018f85d5 |
7 |
|
8 |
sandbox: move verbose startup info behind debug knob |
9 |
|
10 |
These messages aren't super useful to most people, nor are needed on |
11 |
every invocation, so put them behind a debug knob to reduce log spam.x |
12 |
|
13 |
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org> |
14 |
|
15 |
src/sandbox.c | 16 ++++++++-------- |
16 |
1 file changed, 8 insertions(+), 8 deletions(-) |
17 |
|
18 |
diff --git a/src/sandbox.c b/src/sandbox.c |
19 |
index 063974d..02f4cbe 100644 |
20 |
--- a/src/sandbox.c |
21 |
+++ b/src/sandbox.c |
22 |
@@ -234,19 +234,22 @@ int main(int argc, char **argv) |
23 |
sb_err("not launching a new sandbox as one is already running in this process hierarchy"); |
24 |
|
25 |
/* determine the location of all the sandbox support files */ |
26 |
- dputs("Detection of the support files."); |
27 |
+ if (opt_debug) |
28 |
+ dputs("Detection of the support files."); |
29 |
|
30 |
if (-1 == setup_sandbox(&sandbox_info, print_debug)) |
31 |
sb_err("failed to setup sandbox"); |
32 |
|
33 |
/* verify the existance of required files */ |
34 |
- dputs("Verification of the required files."); |
35 |
+ if (opt_debug) |
36 |
+ dputs("Verification of the required files."); |
37 |
|
38 |
if (!rc_file_exists(sandbox_info.sandbox_rc)) |
39 |
sb_perr("could not open the sandbox rc file: %s", sandbox_info.sandbox_rc); |
40 |
|
41 |
/* set up the required environment variables */ |
42 |
- dputs("Setting up the required environment variables."); |
43 |
+ if (opt_debug) |
44 |
+ dputs("Setting up the required environment variables."); |
45 |
|
46 |
/* If not in portage, cd into it work directory */ |
47 |
if ('\0' != sandbox_info.work_dir[0]) |
48 |
@@ -346,9 +349,8 @@ int main(int argc, char **argv) |
49 |
sigaction(SIGHUP, &act_old[0], NULL); |
50 |
|
51 |
/* STARTING PROTECTED ENVIRONMENT */ |
52 |
- dputs("The protected environment has been started."); |
53 |
- dputs(sandbox_footer); |
54 |
- dputs("Process being started in forked instance."); |
55 |
+ if (opt_debug) |
56 |
+ dputs("The protected environment has been started."); |
57 |
|
58 |
/* Start Bash */ |
59 |
int shell_exit = spawn_shell(argv_bash, sandbox_environ, print_debug); |
60 |
@@ -359,8 +361,6 @@ int main(int argc, char **argv) |
61 |
argv_bash = NULL; |
62 |
sandbox_environ = NULL; |
63 |
|
64 |
- dputs("Cleaning up sandbox process"); |
65 |
- dputs(sandbox_banner); |
66 |
dputs("The protected environment has been shut down."); |
67 |
|
68 |
if (rc_file_exists(sandbox_info.sandbox_log)) { |