version 1.50, 2002/12/08 16:50:07 |
version 1.51, 2002/12/17 19:52:02 |
|
|
username, user, ontty()); |
username, user, ontty()); |
|
|
(void)setpriority(PRIO_PROCESS, 0, prio); |
(void)setpriority(PRIO_PROCESS, 0, prio); |
if (emlogin) |
if (emlogin) { |
flags = LOGIN_SETALL & ~LOGIN_SETPATH; |
flags = LOGIN_SETALL & ~LOGIN_SETPATH; |
else |
/* |
|
* Only call setlogin() if this proccess is a session leader. |
|
* In practice, this means the login name will be set only if |
|
* we are exec'd by a shell. This is important because |
|
* otherwise the parent shell's login name would change too. |
|
*/ |
|
if (getsid(0) != getpid()) |
|
flags &= ~LOGIN_SETLOGIN; |
|
} else |
flags = (asthem ? (LOGIN_SETPRIORITY | LOGIN_SETUMASK) : 0) | |
flags = (asthem ? (LOGIN_SETPRIORITY | LOGIN_SETUMASK) : 0) | |
LOGIN_SETRESOURCES | LOGIN_SETGROUP | LOGIN_SETUSER; |
LOGIN_SETRESOURCES | LOGIN_SETGROUP | LOGIN_SETUSER; |
if (setusercontext(lc, pwd, pwd->pw_uid, flags) != 0) |
if (setusercontext(lc, pwd, pwd->pw_uid, flags) != 0) |