diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-15 08:18:46 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-15 08:18:46 +0200 |
commit | 8fa1f5d543266816967949812b65790fbe7cdcd4 (patch) | |
tree | 0a721a6d9b53677ec3e0e5c4a8177a428759957d | |
parent | 889550b36b057fb8ad5c825c7a17e46fde4ebbf6 (diff) | |
download | busybox-w32-8fa1f5d543266816967949812b65790fbe7cdcd4.tar.gz busybox-w32-8fa1f5d543266816967949812b65790fbe7cdcd4.tar.bz2 busybox-w32-8fa1f5d543266816967949812b65790fbe7cdcd4.zip |
hush: fix faloout from previous commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | include/busybox.h | 13 | ||||
-rw-r--r-- | shell/hush.c | 26 |
2 files changed, 20 insertions, 19 deletions
diff --git a/include/busybox.h b/include/busybox.h index 48ce856ea..48fc0b4c8 100644 --- a/include/busybox.h +++ b/include/busybox.h | |||
@@ -35,18 +35,21 @@ extern const uint16_t applet_nameofs[]; | |||
35 | extern const uint8_t applet_install_loc[]; | 35 | extern const uint8_t applet_install_loc[]; |
36 | 36 | ||
37 | #if ENABLE_FEATURE_SUID || ENABLE_FEATURE_PREFER_APPLETS | 37 | #if ENABLE_FEATURE_SUID || ENABLE_FEATURE_PREFER_APPLETS |
38 | #define APPLET_NAME(i) (applet_names + (applet_nameofs[i] & 0x0fff)) | 38 | # define APPLET_NAME(i) (applet_names + (applet_nameofs[i] & 0x0fff)) |
39 | #else | 39 | #else |
40 | #define APPLET_NAME(i) (applet_names + applet_nameofs[i]) | 40 | # define APPLET_NAME(i) (applet_names + applet_nameofs[i]) |
41 | #endif | 41 | #endif |
42 | 42 | ||
43 | #if ENABLE_FEATURE_PREFER_APPLETS | 43 | #if ENABLE_FEATURE_PREFER_APPLETS |
44 | #define APPLET_IS_NOFORK(i) (applet_nameofs[i] & (1 << 12)) | 44 | # define APPLET_IS_NOFORK(i) (applet_nameofs[i] & (1 << 12)) |
45 | #define APPLET_IS_NOEXEC(i) (applet_nameofs[i] & (1 << 13)) | 45 | # define APPLET_IS_NOEXEC(i) (applet_nameofs[i] & (1 << 13)) |
46 | #else | ||
47 | # define APPLET_IS_NOFORK(i) 0 | ||
48 | # define APPLET_IS_NOEXEC(i) 0 | ||
46 | #endif | 49 | #endif |
47 | 50 | ||
48 | #if ENABLE_FEATURE_SUID | 51 | #if ENABLE_FEATURE_SUID |
49 | #define APPLET_SUID(i) ((applet_nameofs[i] >> 14) & 0x3) | 52 | # define APPLET_SUID(i) ((applet_nameofs[i] >> 14) & 0x3) |
50 | #endif | 53 | #endif |
51 | 54 | ||
52 | #if ENABLE_FEATURE_INSTALLER | 55 | #if ENABLE_FEATURE_INSTALLER |
diff --git a/shell/hush.c b/shell/hush.c index 8a467be80..7dacfa0b1 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -4328,9 +4328,7 @@ static NOINLINE int run_pipe(struct pipe *pi) | |||
4328 | } | 4328 | } |
4329 | #endif | 4329 | #endif |
4330 | } | 4330 | } |
4331 | #if ENABLE_FEATURE_SH_STANDALONE | ||
4332 | clean_up_and_ret: | 4331 | clean_up_and_ret: |
4333 | #endif | ||
4334 | restore_redirects(squirrel); | 4332 | restore_redirects(squirrel); |
4335 | unset_vars(new_env); | 4333 | unset_vars(new_env); |
4336 | add_vars(old_vars); | 4334 | add_vars(old_vars); |
@@ -4342,20 +4340,20 @@ static NOINLINE int run_pipe(struct pipe *pi) | |||
4342 | return rcode; | 4340 | return rcode; |
4343 | } | 4341 | } |
4344 | 4342 | ||
4345 | #if ENABLE_FEATURE_SH_STANDALONE | 4343 | if (ENABLE_FEATURE_SH_STANDALONE) { |
4346 | i = find_applet_by_name(argv_expanded[0]); | 4344 | int n = find_applet_by_name(argv_expanded[0]); |
4347 | if (i >= 0 && APPLET_IS_NOFORK(i)) { | 4345 | if (n >= 0 && APPLET_IS_NOFORK(n)) { |
4348 | rcode = setup_redirects(command, squirrel); | 4346 | rcode = setup_redirects(command, squirrel); |
4349 | if (rcode == 0) { | 4347 | if (rcode == 0) { |
4350 | new_env = expand_assignments(argv, command->assignment_cnt); | 4348 | new_env = expand_assignments(argv, command->assignment_cnt); |
4351 | old_vars = set_vars_and_save_old(new_env); | 4349 | old_vars = set_vars_and_save_old(new_env); |
4352 | debug_printf_exec(": run_nofork_applet '%s' '%s'...\n", | 4350 | debug_printf_exec(": run_nofork_applet '%s' '%s'...\n", |
4353 | argv_expanded[0], argv_expanded[1]); | 4351 | argv_expanded[0], argv_expanded[1]); |
4354 | rcode = run_nofork_applet(i, argv_expanded); | 4352 | rcode = run_nofork_applet(n, argv_expanded); |
4353 | } | ||
4354 | goto clean_up_and_ret; | ||
4355 | } | 4355 | } |
4356 | goto clean_up_and_ret; | ||
4357 | } | 4356 | } |
4358 | #endif | ||
4359 | /* It is neither builtin nor applet. We must fork. */ | 4357 | /* It is neither builtin nor applet. We must fork. */ |
4360 | } | 4358 | } |
4361 | 4359 | ||