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

@@ -155,7 +155,7 @@ sudo_execve(const char *path, char *const argv[], char *const envp[], bool noexe
nargv[0] = "sh";
nargv[1] = (char *)path;
memcpy(nargv + 2, argv + 1, argc * sizeof(char *));
execve(_PATH_BSHELL, nargv, envp);
execve(_PATH_SUDO_BSHELL, nargv, envp);
sudo_efree(nargv);
}
return -1;