* configure.in, libmisc/shell.c, libmisc/setupenv.c, src/newgrp.c,
src/su.c: Let the system shell be configurable.
This commit is contained in:
@ -722,7 +722,7 @@ int main (int argc, char **argv)
|
||||
*/
|
||||
if (cflag) {
|
||||
closelog ();
|
||||
execl ("/bin/sh", "sh", "-c", command, (char *) 0);
|
||||
execl (SHELL, "sh", "-c", command, (char *) 0);
|
||||
#ifdef WITH_AUDIT
|
||||
snprintf (audit_buf, sizeof(audit_buf),
|
||||
"changing new-gid=%lu", (unsigned long) gid);
|
||||
@ -730,7 +730,7 @@ int main (int argc, char **argv)
|
||||
audit_buf, NULL,
|
||||
(unsigned int) getuid (), 0);
|
||||
#endif
|
||||
perror ("/bin/sh");
|
||||
perror (SHELL);
|
||||
exit ((errno == ENOENT) ? E_CMD_NOTFOUND : E_CMD_NOEXEC);
|
||||
}
|
||||
|
||||
@ -757,7 +757,7 @@ int main (int argc, char **argv)
|
||||
} else if ((NULL != pwd->pw_shell) && ('\0' != pwd->pw_shell[0])) {
|
||||
prog = pwd->pw_shell;
|
||||
} else {
|
||||
prog = "/bin/sh";
|
||||
prog = SHELL;
|
||||
}
|
||||
|
||||
/*
|
||||
|
4
src/su.c
4
src/su.c
@ -203,7 +203,7 @@ void execve_shell (const char *shellstr, char *args[], char *const envp[])
|
||||
n_args--;
|
||||
}
|
||||
|
||||
(void) execve ("/bin/sh", targs, envp);
|
||||
(void) execve (SHELL, targs, envp);
|
||||
} else {
|
||||
errno = err;
|
||||
}
|
||||
@ -724,7 +724,7 @@ int main (int argc, char **argv)
|
||||
* Set the default shell.
|
||||
*/
|
||||
if ((NULL == shellstr) || ('\0' == shellstr[0])) {
|
||||
shellstr = "/bin/sh";
|
||||
shellstr = SHELL;
|
||||
}
|
||||
|
||||
(void) signal (SIGINT, SIG_IGN);
|
||||
|
Reference in New Issue
Block a user