From 354cc6aa0cf9f6d62dd879c4ab5a2c08257d76ed Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 3 Feb 2019 13:37:58 -0600 Subject: William Djupström pointed out that xexec() lost the absolute path check. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/xwrap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/xwrap.c') diff --git a/lib/xwrap.c b/lib/xwrap.c index 04a4cae3..08b814f1 100644 --- a/lib/xwrap.c +++ b/lib/xwrap.c @@ -207,7 +207,8 @@ pid_t __attribute__((returns_twice)) xvforkwrap(pid_t pid) void xexec(char **argv) { // Only recurse to builtin when we have multiplexer and !vfork context. - if (CFG_TOYBOX && !CFG_TOYBOX_NORECURSE && toys.stacktop) toy_exec(argv); + if (CFG_TOYBOX && !CFG_TOYBOX_NORECURSE && toys.stacktop && **argv != '/') + toy_exec(argv); execvp(argv[0], argv); perror_msg("exec %s", argv[0]); -- cgit v1.2.3