version 1.8, 1996/10/12 20:40:37 |
version 1.9, 1996/10/16 00:37:11 |
|
|
register struct passwd *pwd; |
register struct passwd *pwd; |
register char *p, **g; |
register char *p, **g; |
struct group *gr; |
struct group *gr; |
uid_t ruid, getuid(); |
uid_t ruid; |
int asme, ch, asthem, fastlogin, prio; |
int asme, ch, asthem, fastlogin, prio; |
enum { UNSET, YES, NO } iscsh = UNSET; |
enum { UNSET, YES, NO } iscsh = UNSET; |
char *user, *shell, *avshell, *username, *cleanenv[10], **np; |
char *user, *shell, *avshell, *username, *cleanenv[10], **np; |
|
|
pwd = getpwuid(ruid); |
pwd = getpwuid(ruid); |
if (pwd == NULL) |
if (pwd == NULL) |
errx(1, "who are you?"); |
errx(1, "who are you?"); |
username = strdup(pwd->pw_name); |
if ((username = strdup(pwd->pw_name)) == NULL) |
|
err(1, "can't allocate memory"); |
if (asme) |
if (asme) |
if (pwd->pw_shell && *pwd->pw_shell) |
if (pwd->pw_shell && *pwd->pw_shell) |
shell = strcpy(shellbuf, pwd->pw_shell); |
shell = strcpy(shellbuf, pwd->pw_shell); |
else { |
else { |
shell = _PATH_BSHELL; |
shell = _PATH_BSHELL; |
iscsh = NO; |
iscsh = NO; |
|
|
(void)setpriority(PRIO_PROCESS, 0, prio); |
(void)setpriority(PRIO_PROCESS, 0, prio); |
|
|
execv(shell, np); |
execv(shell, np); |
err(1, "%s", shell); |
err(1, shell); |
} |
} |
|
|
int |
int |