[PATCH v3 09/27] svlogd: replace execl call with BB_EXECVP
Nadav Tasher
tashernadav at gmail.com
Mon Jan 27 00:04:20 UTC 2025
Allows for more control over executed processes.
Signed-off-by: Nadav Tasher <tashernadav at gmail.com>
---
runit/svlogd.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/runit/svlogd.c b/runit/svlogd.c
index f7576f0fa..9b615a05d 100644
--- a/runit/svlogd.c
+++ b/runit/svlogd.c
@@ -393,6 +393,7 @@ static void processorstart(struct logdir *ld)
{
char sv_ch;
int pid;
+ char* shell_argv[4];
if (!ld->processor) return;
if (ld->ppid) {
@@ -453,7 +454,11 @@ static void processorstart(struct logdir *ld)
fd = xopen("newstate", O_WRONLY|O_NDELAY|O_TRUNC|O_CREAT);
xmove_fd(fd, 5);
- execl(G.shell, G.shell, "-c", ld->processor, (char*) NULL);
+ shell_argv[0] = (char *) G.shell;
+ shell_argv[1] = (char *) "-c";
+ shell_argv[2] = ld->processor;
+ shell_argv[3] = NULL;
+ BB_EXECVP(shell_argv[0], shell_argv);
bb_perror_msg_and_die(FATAL"can't %s processor %s", "run", ld->name);
}
ld->fnsave[26] = sv_ch; /* ...restore */
--
2.43.0
More information about the busybox
mailing list