This replaces all invocations of functions from the exec
family with the equivalent proxy functions.
This change provides better control over executed programs
and allows all applets to seamlessly execute other applets
when FEATURE_PREFER_APPLETS is enabled.
Signed-off-by: Nadav Tasher
---
arch
This commit implements the close_cloexec_fds() function,
which manually closes all FDs that have the FD_CLOEXEC flag.
Signed-off-by: Nadav Tasher
---
include/libbb.h | 1 +
libbb/xfuncs.c | 10 ++
2 files changed, 11 insertions(+)
diff --git a/include/libbb.h b/include/libbb.h
index b
This commit implements proxy functions for the exec family of
functions.
bb_execv, bb_execve, bb_execvp and bb_execvpe were implemented as
proxy functions to their libc counterparts.
applet_execve and applet_execvpe were implemented as internal utility
functions and are used by bb_exec function f
This change allows moving NOEXEC support to bb_execvp.
This reduces code duplication and broadens the support of
NOEXEC applet execution in the codebase.
Signed-off-by: Nadav Tasher
---
libbb/vfork_daemon_rexec.c | 29 +++--
1 file changed, 15 insertions(+), 14 deletions(
This commit makes the shell use the bb_execve proxy function.
bb_execve calls applet_execve, which might execute applets
directly.
Signed-off-by: Nadav Tasher
---
shell/ash.c | 72 +++--
1 file changed, 26 insertions(+), 46 deletions(-)
diff --git
By using bb_execv, an applet can be executed with NOEXEC
instead of actually re-executing the binary, which might
not work in scenareos where busybox is embedded into
another binary.
Signed-off-by: Nadav Tasher
---
libbb/vfork_daemon_rexec.c | 9 +++--
1 file changed, 7 insertions(+), 2 dele
Using xfork() instead of xvfork() on MMU targets improves
security and stability.
Memory efficiency differences are negligable since most
kernels implement fork() with CoW.
Signed-off-by: Nadav Tasher
---
include/libbb.h | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a
Implemented bb_system using spawn_and_wait in conjuction with "sh",
to allow bb_system to execute the internal shell when using the
FEATURE_PREFER_APPLETS config option.
When FEATURE_PREFER_APPLETS is disabled, libc "system()" is used.
Signed-off-by: Nadav Tasher
---
include/libbb.h
This commit adds the reset_all_signals() function,
which resets all custom signal handlers to the default
signal handler (SIG_DFL).
Signed-off-by: Nadav Tasher
---
include/libbb.h | 2 ++
libbb/signals.c | 26 ++
2 files changed, 28 insertions(+)
diff --git a/include/li
Using bb_execvp allows for more control over the compressor
program executed, and might execute an applet instead of an
external program.
The xz compressor is disabled when FEATURE_PREFER_APPLETS is
enabled, since the xz applet does not support compression.
Signed-off-by: Nadav Tasher
---
archi
This patch adds an experimental configuration option to allow the
applet_execvpe function to treat all applets as if they were NOEXEC.
This is experimental, as noted in the configuration description.
Signed-off-by: Nadav Tasher
---
Config.in | 12
libbb/executable.c | 2 +
Allows for execution of the internal shell when the
FEATURE_PREFER_APPLETS configuration option is enabled..
Signed-off-by: Nadav Tasher
---
archival/dpkg.c | 2 +-
editors/awk.c | 2 +-
editors/vi.c | 2 +-
init/bootchartd.c | 2 +-
miscutils/man.c | 2 +-
netwo
Due to a limit imposed by FEATURE_FORCE_APPLETS, execv is not allowed.
The execv call is required to execute CGI binaries, so it makes
FEATURE_HTTPD_CGI depend on FEATURE_FORCE_APPLET being disabled.
The execv call was changed to bb_execv, mostly for keeping the
codebase consistent, as all applets
13 matches
Mail list logo