diff options
author | Ron Yorston <rmy@pobox.com> | 2020-06-09 16:26:34 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2020-06-09 16:52:45 +0100 |
commit | 32833bc06873f83c786232617b4390b60252c417 (patch) | |
tree | 8f175374e2f43538ab65c5b5b550cd10d71bc0de /libbb/appletlib.c | |
parent | 4fe76647b356a85810fa3d355d7ad0512be1210c (diff) | |
download | busybox-w32-32833bc06873f83c786232617b4390b60252c417.tar.gz busybox-w32-32833bc06873f83c786232617b4390b60252c417.tar.bz2 busybox-w32-32833bc06873f83c786232617b4390b60252c417.zip |
ash: treat all applets as NOEXEC
In standalone shell mode tryexec() treats all applets as NOEXEC.
Except for the shell: calling ash_main() recursively seems unwise.
This avoids creating a new process for the applet (which is a Good
Thing on Microsoft Windows where creating processes is expensive) but
leaves the resources used by the invoking shell in the current process.
Diffstat (limited to 'libbb/appletlib.c')
-rw-r--r-- | libbb/appletlib.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index b2c85905c..9caa04ac3 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -1122,6 +1122,9 @@ void FAST_FUNC run_applet_no_and_exit(int applet_no, const char *name, char **ar | |||
1122 | # if defined APPLET_NO_false | 1122 | # if defined APPLET_NO_false |
1123 | && applet_no != APPLET_NO_false | 1123 | && applet_no != APPLET_NO_false |
1124 | # endif | 1124 | # endif |
1125 | # if defined APPLET_NO_busybox | ||
1126 | && applet_no != APPLET_NO_busybox | ||
1127 | # endif | ||
1125 | ) { | 1128 | ) { |
1126 | if (argc == 2 && strcmp(argv[1], "--help") == 0) { | 1129 | if (argc == 2 && strcmp(argv[1], "--help") == 0) { |
1127 | /* Make "foo --help" exit with 0: */ | 1130 | /* Make "foo --help" exit with 0: */ |