[PATCH 06/18] conspy: replace execl call with BB_EXECVP
Nadav Tasher
tashernadav at gmail.com
Sun Jan 19 23:10:22 UTC 2025
Allows for more control over executed processes,
reduces code duplication by using BB_EXECVP_or_die.
Signed-off-by: Nadav Tasher <tashernadav at gmail.com>
---
miscutils/conspy.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/miscutils/conspy.c b/miscutils/conspy.c
index 21a498d0f..5ad19bbdc 100644
--- a/miscutils/conspy.c
+++ b/miscutils/conspy.c
@@ -332,6 +332,7 @@ static void create_cdev_if_doesnt_exist(const char* name, dev_t dev)
static NOINLINE void start_shell_in_child(const char* tty_name)
{
+ char* shell_argv[3];
int pid = xvfork();
if (pid == 0) {
struct termios termchild;
@@ -353,8 +354,10 @@ static NOINLINE void start_shell_in_child(const char* tty_name)
termchild.c_iflag |= ICRNL;
termchild.c_iflag &= ~IXOFF;
tcsetattr_stdin_TCSANOW(&termchild);
- execl(shell, shell, "-i", (char *) NULL);
- bb_simple_perror_msg_and_die(shell);
+ shell_argv[0] = (char *) shell;
+ shell_argv[1] = (char *) "-i";
+ shell_argv[2] = NULL;
+ BB_EXECVP_or_die(shell_argv);
}
}
--
2.43.0
More information about the busybox
mailing list