(which is usually ksh). This makes sudo's behavior when executing
a shell without the #! magic number match execvp() on AIX.
#ifndef _PATH_NETSVC_CONF
# undef _PATH_NETSVC_CONF
#endif /* _PATH_NETSVC_CONF */
+
+/* On AIX, _PATH_BSHELL is /usr/bin/bsh but we want /usr/bin/sh */
+#ifndef _PATH_SUDO_BSHELL
+# ifdef _AIX
+# define _PATH_SUDO_BSHELL "/usr/bin/sh"
+# else
+# define _PATH_SUDO_BSHELL _PATH_BSHELL
+# endif
+#endif /* _PATH_SUDO_BSHELL */
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;
/* 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);