aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-10-29 00:02:22 -0400
committerMike Frysinger <vapier@gentoo.org>2021-10-29 00:02:22 -0400
commitb9a9f6239d46f54ff1fc747b73ddf58082aa6559 (patch)
tree1f1cb4a021d680fdc3ada384d0e6fcfbc0106282 /libsandbox
parentsandbox: change interface to make it easier to pass thru (diff)
downloadsandbox-b9a9f6239d46f54ff1fc747b73ddf58082aa6559.tar.gz
sandbox-b9a9f6239d46f54ff1fc747b73ddf58082aa6559.tar.bz2
sandbox-b9a9f6239d46f54ff1fc747b73ddf58082aa6559.zip
libsandbox: drop args to trace_main
The filename was only used for a single debug print, and the args ignored completely. Don't bother passing them down at all. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libsandbox')
-rw-r--r--libsandbox/libsandbox.h2
-rw-r--r--libsandbox/trace.c6
-rw-r--r--libsandbox/wrapper-funcs/__wrapper_exec.c6
3 files changed, 7 insertions, 7 deletions
diff --git a/libsandbox/libsandbox.h b/libsandbox/libsandbox.h
index fbea6ba..206c506 100644
--- a/libsandbox/libsandbox.h
+++ b/libsandbox/libsandbox.h
@@ -82,7 +82,7 @@ extern void sb_lock(void);
extern void sb_unlock(void);
bool trace_possible(const char *filename, char *const argv[], const void *data);
-void trace_main(const char *filename, char *const argv[]);
+void trace_main(void);
/* glibc modified realpath() function */
char *erealpath(const char *, char *);
diff --git a/libsandbox/trace.c b/libsandbox/trace.c
index d53051d..4e01f6e 100644
--- a/libsandbox/trace.c
+++ b/libsandbox/trace.c
@@ -510,12 +510,10 @@ static void trace_loop(void)
} while (1);
}
-void trace_main(const char *filename, char *const argv[])
+void trace_main(void)
{
struct sigaction old_sa, sa = { .sa_handler = SIG_DFL, };
- sb_debug_dyn("trace_main: tracing: %s\n", filename);
-
if (trace_pid)
sb_ebort("ISE: trace code assumes multiple threads are not forking\n");
@@ -550,7 +548,7 @@ void trace_main(const char *filename, char *const argv[])
#undef _trace_possible
#define _trace_possible(data) false
-void trace_main(const char *filename, char *const argv[])
+void trace_main(void)
{
/* trace_possible() triggers a warning for us */
}
diff --git a/libsandbox/wrapper-funcs/__wrapper_exec.c b/libsandbox/wrapper-funcs/__wrapper_exec.c
index 8ea5255..d66e3a0 100644
--- a/libsandbox/wrapper-funcs/__wrapper_exec.c
+++ b/libsandbox/wrapper-funcs/__wrapper_exec.c
@@ -242,8 +242,10 @@ static bool sb_check_exec(const char *filename, char *const argv[])
out_fd:
close(fd);
- if (do_trace)
- trace_main(filename, argv);
+ if (do_trace) {
+ sb_debug_dyn("tracing: %s\n", filename);
+ trace_main();
+ }
return run_in_process;
}