[PATCH v3 11/27] ifupdown: replace execle call with BB_EXECVPE
Nadav Tasher
tashernadav at gmail.com
Mon Jan 27 00:04:22 UTC 2025
Allows for more control over executed processes.
Signed-off-by: Nadav Tasher <tashernadav at gmail.com>
---
networking/ifupdown.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 9c3640be7..d083eeee2 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -1146,6 +1146,7 @@ static void set_environ(struct interface_defn_t *iface, const char *mode, const
static int doit(char *str)
{
+ char* shell_argv[4] = { G.shell, (char *) "-c", str, NULL};
if (option_mask32 & (OPT_no_act|OPT_verbose)) {
puts(str);
}
@@ -1158,7 +1159,7 @@ static int doit(char *str)
if (child < 0) /* failure */
return 0;
if (child == 0) { /* child */
- execle(G.shell, G.shell, "-c", str, (char *) NULL, G.my_environ);
+ BB_EXECVPE(shell_argv[0], shell_argv, G.my_environ);
_exit(127);
}
safe_waitpid(child, &status, 0);
--
2.43.0
More information about the busybox
mailing list