On AIX, _PATH_BSHELL is /usr/bin/bsh but we want to use /usr/bin/sh

(which is usually ksh).  This makes sudo's behavior when executing
a shell without the #! magic number match execvp() on AIX.
This commit is contained in:
Todd C. Miller
2014-09-20 09:21:51 -06:00
parent d4d724b886
commit 7ab40be5c0
3 changed files with 11 additions and 2 deletions

View File

@@ -471,7 +471,7 @@ get_user_info(struct user_details *ud)
/* Stash user's shell for use with the -s flag; don't pass to plugin. */
if ((ud->shell = getenv("SHELL")) == NULL || ud->shell[0] == '\0') {
ud->shell = pw->pw_shell[0] ? pw->pw_shell : _PATH_BSHELL;
ud->shell = pw->pw_shell[0] ? pw->pw_shell : _PATH_SUDO_BSHELL;
}
ud->shell = sudo_estrdup(ud->shell);