[PATCH 17/18] tar: replace execlp call with BB_EXECVP, disable xz compression when applets are prefered

2025-01-19 Thread Nadav Tasher
Use BB_EXECVP for better consistency with other applets. Allows for more control over exactly which compressor is used. The xz compressor is disabled when applets are prefered, since the xz applet does not support compression. Signed-off-by: Nadav Tasher --- archival/tar.c | 11 +-- 1 f

[PATCH 15/18] BB_EXECVP: make BB_EXECVP do NOEXEC logic and allow it to to force applet execution

2025-01-19 Thread Nadav Tasher
This patch makes BB_EXECVP the gateway to the exec syscall family. When called, it first looks for a matching applet, and executes it directly of indirectly by re-executing the binary. This new behaviour is configurable by the new FEATURE_FORCE_NOEXEC option. When FEATURE_FORCE_APPLETS is enabled

[PATCH 18/18] ash: use BB_EXECVPE to execute commands with FEATURE_SH_STANDALONE

2025-01-19 Thread Nadav Tasher
This change makes the standalone shell use the BB_EXECVPE utility. BB_EXECVPE calls BB_EXECVP which has NOEXEC and applets only logic. This allows for better control of the executed processes. Signed-off-by: Nadav Tasher --- shell/ash.c | 61 +++--

[PATCH 02/18] bootchartd: convert execl calls to BB_EXECVP

2025-01-19 Thread Nadav Tasher
Signed-off-by: Nadav Tasher --- init/bootchartd.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/init/bootchartd.c b/init/bootchartd.c index 0929890a3..0833e0fe4 100644 --- a/init/bootchartd.c +++ b/init/bootchartd.c @@ -355,6 +355,7 @@ int bootchartd_mai

[PATCH 03/18] halt: convert execlp call to BB_EXECVP

2025-01-19 Thread Nadav Tasher
Allows for more control over executed processes, reduces code duplication using BB_EXECVP_or_die. Signed-off-by: Nadav Tasher --- init/halt.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/init/halt.c b/init/halt.c index 7aea8cfec..5e6d2 100644 --- a/init/ha

[PATCH 08/18] script: replace execl call with BB_EXECVP

2025-01-19 Thread Nadav Tasher
Allows for more control over executed processes, reduces code duplication by using BB_EXECVP_or_die. Signed-off-by: Nadav Tasher --- util-linux/script.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/util-linux/script.c b/util-linux/script.c index 58b844e77..46a038c1

[PATCH 11/18] ifupdown: replace execle call with BB_EXECVPE

2025-01-19 Thread Nadav Tasher
Allows for more control over executed processes. Signed-off-by: Nadav Tasher --- networking/ifupdown.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 9c3640be7..d0832 100644 --- a/networking/ifupdown.c +++ b/networkin

[PATCH 09/18] svlogd: replace execl call with BB_EXECVP

2025-01-19 Thread Nadav Tasher
Allows for more control over executed processes. Signed-off-by: Nadav Tasher --- 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 @

[PATCH 13/18] runsvdir: replace execlp call with BB_EXECVP

2025-01-19 Thread Nadav Tasher
Allows for more control over executed processes. Signed-off-by: Nadav Tasher --- runit/runsvdir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runit/runsvdir.c b/runit/runsvdir.c index d6629dedd..f08880767 100644 --- a/runit/runsvdir.c +++ b/runit/runsvdir.c @@ -119,6 +1

[PATCH 14/18] Config.in: FEATURE_PREFER_APPLETS depends on !BUILD_INDIVIDUAL

2025-01-19 Thread Nadav Tasher
Having FEATURE_PREFER_APPLETS on while building individual applets seems like a bad idea. Applets would try to execute theirselves with different argument if applets are prefered. Signed-off-by: Nadav Tasher --- Config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/Config.in b/Config.in

[PATCH 06/18] conspy: replace execl call with BB_EXECVP

2025-01-19 Thread Nadav Tasher
Allows for more control over executed processes, reduces code duplication by using BB_EXECVP_or_die. Signed-off-by: Nadav Tasher --- miscutils/conspy.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/miscutils/conspy.c b/miscutils/conspy.c index 21a498d0f..5ad19bbdc 10

[PATCH 16/18] vfork_daemon_rexec: update spawn_and_wait function to use BB_EXECVP

2025-01-19 Thread Nadav Tasher
Using BB_EXECVP ensures consistency with spawn() function, and allows moving NOEXEC support to BB_EXECVP, which makes BB_EXECVP to go-to function for running new processes. Signed-off-by: Nadav Tasher --- libbb/vfork_daemon_rexec.c | 25 + 1 file changed, 13 insertions(+)

[PATCH 12/18] runsv: change execl calls to BB_EXECVP

2025-01-19 Thread Nadav Tasher
Allows for more control over executed processes. Signed-off-by: Nadav Tasher --- runit/runsv.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/runit/runsv.c b/runit/runsv.c index 20a445319..27676e0be 100644 --- a/runit/runsv.c +++ b/runit/runsv.c @@ -280,6 +280,7 @@ st

[PATCH 07/18] crontab: replace BB_EXECLP call with BB_EXECVP

2025-01-19 Thread Nadav Tasher
Allows for more control over executed processes, reduces code duplication by using BB_EXECVP_or_die. Signed-off-by: Nadav Tasher --- miscutils/crontab.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/miscutils/crontab.c b/miscutils/crontab.c index f4d54..840df5d5d

[PATCH 10/18] crond: replace execlp calls with BB_EXECVP

2025-01-19 Thread Nadav Tasher
Allows for more control over executed processes. Signed-off-by: Nadav Tasher --- miscutils/crond.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/miscutils/crond.c b/miscutils/crond.c index b3762d327..e3f333edb 100644 --- a/miscutils/crond.c +++ b/mis

[PATCH 04/18] adduser: replace BB_EXECLP call with BB_EXECVP

2025-01-19 Thread Nadav Tasher
Signed-off-by: Nadav Tasher --- loginutils/adduser.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/loginutils/adduser.c b/loginutils/adduser.c index d3c795afa..d9f682389 100644 --- a/loginutils/adduser.c +++ b/loginutils/adduser.c @@ -158,8 +158,12 @@ static void pas

Making BusyBox self-contained by modifying exec calls and NOEXEC behaviour

2025-01-19 Thread Nadav Tasher
Hi all! This patch series aims to make some improvements in the way BusyBox handles execXX calls. My goal is to have a gateway function that can be used to proxy all execXX calls made by BusyBox applets. This is quite useful when running BusyBox in a contrained environment. I took the liberty of

[PATCH 01/18] BB_EXECVP: replace execv and execvp calls with BB_EXECVP

2025-01-19 Thread Nadav Tasher
Change calls from execv and execvp to BB_EXECVP for more consistency across applets and more control over executed processes. Signed-off-by: Nadav Tasher --- console-tools/reset.c | 2 +- debianutils/start_stop_daemon.c | 2 +- libbb/run_shell.c | 2 +- networking/ftpd.c

[PATCH 05/18] getty: change BB_EXECLP call to BB_EXECVP

2025-01-19 Thread Nadav Tasher
Allows for more control over executed processes, reduces code duplication by using BB_EXECVP_or_die. Signed-off-by: Nadav Tasher --- loginutils/getty.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/loginutils/getty.c b/loginutils/getty.c index 4581cc9f7..f5ed2c85c 1