1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-15 07:54:13 +00:00

If SHELL is not set, fall back to /bin/sh so CHAT(SHELL) might work. (#424)

This commit is contained in:
Nick Briggs 2022-05-28 12:37:43 -07:00 committed by GitHub
parent a18f09d788
commit 60af445afa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 */
shell = getenv("SHELL");
if (shell == NULL) /* shell of last resort */
shell = "/bin/sh";
for (userShell = getusershell(); userShell != NULL && strcmp(shell, userShell) != 0; userShell = getusershell());
if (userShell == NULL) {
perror("$(SHELL) not found in /etc/shells");