hush: fix faloout from previous commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
889550b36b
commit
8fa1f5d543
@ -35,18 +35,21 @@ extern const uint16_t applet_nameofs[];
|
|||||||
extern const uint8_t applet_install_loc[];
|
extern const uint8_t applet_install_loc[];
|
||||||
|
|
||||||
#if ENABLE_FEATURE_SUID || ENABLE_FEATURE_PREFER_APPLETS
|
#if ENABLE_FEATURE_SUID || ENABLE_FEATURE_PREFER_APPLETS
|
||||||
#define APPLET_NAME(i) (applet_names + (applet_nameofs[i] & 0x0fff))
|
# define APPLET_NAME(i) (applet_names + (applet_nameofs[i] & 0x0fff))
|
||||||
#else
|
#else
|
||||||
#define APPLET_NAME(i) (applet_names + applet_nameofs[i])
|
# define APPLET_NAME(i) (applet_names + applet_nameofs[i])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLE_FEATURE_PREFER_APPLETS
|
#if ENABLE_FEATURE_PREFER_APPLETS
|
||||||
#define APPLET_IS_NOFORK(i) (applet_nameofs[i] & (1 << 12))
|
# define APPLET_IS_NOFORK(i) (applet_nameofs[i] & (1 << 12))
|
||||||
#define APPLET_IS_NOEXEC(i) (applet_nameofs[i] & (1 << 13))
|
# define APPLET_IS_NOEXEC(i) (applet_nameofs[i] & (1 << 13))
|
||||||
|
#else
|
||||||
|
# define APPLET_IS_NOFORK(i) 0
|
||||||
|
# define APPLET_IS_NOEXEC(i) 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLE_FEATURE_SUID
|
#if ENABLE_FEATURE_SUID
|
||||||
#define APPLET_SUID(i) ((applet_nameofs[i] >> 14) & 0x3)
|
# define APPLET_SUID(i) ((applet_nameofs[i] >> 14) & 0x3)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if ENABLE_FEATURE_INSTALLER
|
#if ENABLE_FEATURE_INSTALLER
|
||||||
|
26
shell/hush.c
26
shell/hush.c
@ -4328,9 +4328,7 @@ static NOINLINE int run_pipe(struct pipe *pi)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#if ENABLE_FEATURE_SH_STANDALONE
|
|
||||||
clean_up_and_ret:
|
clean_up_and_ret:
|
||||||
#endif
|
|
||||||
restore_redirects(squirrel);
|
restore_redirects(squirrel);
|
||||||
unset_vars(new_env);
|
unset_vars(new_env);
|
||||||
add_vars(old_vars);
|
add_vars(old_vars);
|
||||||
@ -4342,20 +4340,20 @@ static NOINLINE int run_pipe(struct pipe *pi)
|
|||||||
return rcode;
|
return rcode;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ENABLE_FEATURE_SH_STANDALONE
|
if (ENABLE_FEATURE_SH_STANDALONE) {
|
||||||
i = find_applet_by_name(argv_expanded[0]);
|
int n = find_applet_by_name(argv_expanded[0]);
|
||||||
if (i >= 0 && APPLET_IS_NOFORK(i)) {
|
if (n >= 0 && APPLET_IS_NOFORK(n)) {
|
||||||
rcode = setup_redirects(command, squirrel);
|
rcode = setup_redirects(command, squirrel);
|
||||||
if (rcode == 0) {
|
if (rcode == 0) {
|
||||||
new_env = expand_assignments(argv, command->assignment_cnt);
|
new_env = expand_assignments(argv, command->assignment_cnt);
|
||||||
old_vars = set_vars_and_save_old(new_env);
|
old_vars = set_vars_and_save_old(new_env);
|
||||||
debug_printf_exec(": run_nofork_applet '%s' '%s'...\n",
|
debug_printf_exec(": run_nofork_applet '%s' '%s'...\n",
|
||||||
argv_expanded[0], argv_expanded[1]);
|
argv_expanded[0], argv_expanded[1]);
|
||||||
rcode = run_nofork_applet(i, argv_expanded);
|
rcode = run_nofork_applet(n, argv_expanded);
|
||||||
|
}
|
||||||
|
goto clean_up_and_ret;
|
||||||
}
|
}
|
||||||
goto clean_up_and_ret;
|
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
/* It is neither builtin nor applet. We must fork. */
|
/* It is neither builtin nor applet. We must fork. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user