version 1.39, 2001/06/25 16:18:38 |
version 1.40, 2001/06/25 21:29:31 |
|
|
/* get current login name and shell */ |
/* get current login name and shell */ |
ruid = getuid(); |
ruid = getuid(); |
username = getlogin(); |
username = getlogin(); |
|
|
|
if(username != NULL) |
|
auth_setoption(as, "invokinguser", username); |
|
|
if (username == NULL || (pwd = getpwnam(username)) == NULL || |
if (username == NULL || (pwd = getpwnam(username)) == NULL || |
pwd->pw_uid != ruid) |
pwd->pw_uid != ruid) |
pwd = getpwuid(ruid); |
pwd = getpwuid(ruid); |
|
|
if ((pwd->pw_uid || !style || strcmp(style, LOGIN_DEFSTYLE)) && |
if ((pwd->pw_uid || !style || strcmp(style, LOGIN_DEFSTYLE)) && |
(style = login_getstyle(lc, style, "auth-su")) == NULL) |
(style = login_getstyle(lc, style, "auth-su")) == NULL) |
auth_errx(as, 1, "invalid authentication type"); |
auth_errx(as, 1, "invalid authentication type"); |
if (pwd->pw_uid || strcmp(user, "root") != 0) |
fullname = user; |
fullname = user; |
|
else { |
|
if ((fullname = |
|
malloc(strlen(username) + 6)) == NULL) |
|
auth_err(as, 1, NULL); |
|
(void)sprintf(fullname, "%s.root", username); |
|
} |
|
/* |
/* |
* Let the authentication program know whether they are |
* Let the authentication program know whether they are |
* in group wheel or not (if trying to become super user) |
* in group wheel or not (if trying to become super user) |