mirror of
https://github.com/Interlisp/maiko.git
synced 2026-05-05 15:54:21 +00:00
If SHELL is not set, fall back to /bin/sh so CHAT(SHELL) might work. (#424)
This commit is contained in:
@@ -129,6 +129,8 @@ static int ForkUnixShell(int slot, char *PtySlave, char *termtype, char *shellar
|
|||||||
}
|
}
|
||||||
/* Start up shell -- use SHELL environment variable as long as it's in /etc/shells */
|
/* Start up shell -- use SHELL environment variable as long as it's in /etc/shells */
|
||||||
shell = getenv("SHELL");
|
shell = getenv("SHELL");
|
||||||
|
if (shell == NULL) /* shell of last resort */
|
||||||
|
shell = "/bin/sh";
|
||||||
for (userShell = getusershell(); userShell != NULL && strcmp(shell, userShell) != 0; userShell = getusershell());
|
for (userShell = getusershell(); userShell != NULL && strcmp(shell, userShell) != 0; userShell = getusershell());
|
||||||
if (userShell == NULL) {
|
if (userShell == NULL) {
|
||||||
perror("$(SHELL) not found in /etc/shells");
|
perror("$(SHELL) not found in /etc/shells");
|
||||||
|
|||||||
Reference in New Issue
Block a user