Lines Matching defs:shell
22 * This is a program to execute 'execute only' and suid/sgid shell scripts.
35 * user and group id correctly, and then exec the shell.
89 static char *shell;
236 shell = getenv("SHELL");
237 if(shell == 0 || !endsh(shell) || (
238 !in_dir("/bin",shell) &&
239 !in_dir("/usr/bin",shell) &&
240 !in_dir("/usr/lbin",shell) &&
241 !in_dir("/usr/local/bin",shell)))
242 shell = DEFSHELL;
245 execv(shell,argv);
250 * return true of shell ends in sh of ksh
253 static int endsh(register const char *shell)
255 while(*shell)
256 shell++;
257 if(*--shell != 'h' || *--shell != 's')
259 if(*--shell=='/')
261 if(*shell=='k' && *--shell=='/')
268 * return true of shell is in <dir> directory
271 static int in_dir(register const char *dir,register const char *shell)
275 if(*dir++ != *shell++)
279 return(*shell=='/');