version 1.47, 2002/10/16 01:06:32 |
version 1.48, 2002/11/08 23:20:19 |
|
|
int |
int |
main(int argc, char **argv) |
main(int argc, char **argv) |
{ |
{ |
int asme = 0, asthem = 0, ch, fastlogin = 0, emlogin = 0, prio; |
int asme = 0, asthem = 0, ch, fastlogin = 0, emlogin = 0, flags, prio; |
char *user, *shell = NULL, *avshell, *username, **np; |
char *user, *shell = NULL, *avshell, *username, **np; |
char *class = NULL, *style = NULL, *p; |
char *class = NULL, *style = NULL, *p; |
enum { UNSET, YES, NO } iscsh = UNSET; |
enum { UNSET, YES, NO } iscsh = UNSET; |
|
|
username, user, ontty()); |
username, user, ontty()); |
|
|
(void)setpriority(PRIO_PROCESS, 0, prio); |
(void)setpriority(PRIO_PROCESS, 0, prio); |
if (setusercontext(lc, pwd, pwd->pw_uid, |
if (emlogin) |
(asthem ? (LOGIN_SETPRIORITY | LOGIN_SETUMASK) : 0) | |
flags = LOGIN_SETALL & ~LOGIN_SETPATH; |
LOGIN_SETRESOURCES | LOGIN_SETGROUP | LOGIN_SETUSER)) |
else |
|
flags = (asthem ? (LOGIN_SETPRIORITY | LOGIN_SETUMASK) : 0) | |
|
LOGIN_SETRESOURCES | LOGIN_SETGROUP | LOGIN_SETUSER; |
|
if (setusercontext(lc, pwd, pwd->pw_uid, flags) != 0) |
auth_err(as, 1, "unable to set user context"); |
auth_err(as, 1, "unable to set user context"); |
if (pwd->pw_uid && auth_approval(as, lc, pwd->pw_name, "su") <= 0) |
if (pwd->pw_uid && auth_approval(as, lc, pwd->pw_name, "su") <= 0) |
auth_err(as, 1, "approval failure"); |
auth_err(as, 1, "approval failure"); |