version 1.10, 2008/12/16 05:25:55 |
version 1.11, 2009/03/05 20:53:13 |
|
|
return (0); |
return (0); |
} |
} |
|
|
char * |
int |
ok_shell(char *name) |
ok_shell(char *name, char **out) |
{ |
{ |
char *p, *sh; |
char *p, *sh; |
|
|
setusershell(); |
setusershell(); |
while ((sh = getusershell()) != NULL) { |
while ((sh = getusershell()) != NULL) { |
if (!strcmp(name, sh)) |
if (!strcmp(name, sh)) |
return (name); |
break; |
/* allow just shell name, but use "real" path */ |
/* allow just shell name, but use "real" path */ |
if ((p = strrchr(sh, '/')) && strcmp(name, p + 1) == 0) |
if ((p = strrchr(sh, '/')) && strcmp(name, p + 1) == 0) |
return (sh); |
break; |
} |
} |
return (NULL); |
if (sh && out) |
|
*out = strdup(sh); |
|
endusershell(); |
|
return (sh != NULL); |
} |
} |