aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-11-27 14:34:25 +0000
committerDenys Vlasenko <vda.linux@googlemail.com>2018-11-27 16:13:07 +0100
commit71df2d3589e3e682cd6770f41f0b184841b78702 (patch)
tree0c71963e9d622bc48256a3917c1ce55ccc019a4f /libbb
parentf4709d78cb0c4f54283046e8f86edb9ecd7e41ca (diff)
downloadbusybox-w32-71df2d3589e3e682cd6770f41f0b184841b78702.tar.gz
busybox-w32-71df2d3589e3e682cd6770f41f0b184841b78702.tar.bz2
busybox-w32-71df2d3589e3e682cd6770f41f0b184841b78702.zip
hush: allow hush to run embedded scripts
Embedded scripts require a shell to be present in the BusyBox binary. Allow either ash or hush to be used for this purpose. If both are enabled ash takes precedence. The size of the binary is unchanged in the default configuration: both ash and hush are present but support for embedded scripts isn't compiled into hush. Signed-off-by: Ron Yorston <rmy@pobox.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/appletlib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c
index a79a37efb..cd09b620c 100644
--- a/libbb/appletlib.c
+++ b/libbb/appletlib.c
@@ -50,7 +50,7 @@
50 50
51#include "usage_compressed.h" 51#include "usage_compressed.h"
52 52
53#if ENABLE_ASH_EMBEDDED_SCRIPTS 53#if ENABLE_FEATURE_SH_EMBEDDED_SCRIPTS
54# define DEFINE_SCRIPT_DATA 1 54# define DEFINE_SCRIPT_DATA 1
55# include "embedded_scripts.h" 55# include "embedded_scripts.h"
56#else 56#else
@@ -774,7 +774,13 @@ int scripted_main(int argc UNUSED_PARAM, char **argv)
774{ 774{
775 int script = find_script_by_name(applet_name); 775 int script = find_script_by_name(applet_name);
776 if (script >= 0) 776 if (script >= 0)
777#if ENABLE_ASH || ENABLE_SH_IS_ASH || ENABLE_BASH_IS_ASH
777 exit(ash_main(-script - 1, argv)); 778 exit(ash_main(-script - 1, argv));
779#elif ENABLE_HUSH || ENABLE_SH_IS_HUSH || ENABLE_BASH_IS_HUSH
780 exit(hush_main(-script - 1, argv));
781#else
782 return 1;
783#endif
778 return 0; 784 return 0;
779} 785}
780 786