mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 12:28:58 +00:00
rexecd was not calling "setlogin()" when it should have. This was causing
getlogin() to return wrong answers (eg: "root"). Reviewed by: davidg Obtained from: James Jegers, for NetBSD, slightly reworked by me.
This commit is contained in:
parent
d49c99ba9c
commit
3f59b9c4ef
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9765
@ -258,6 +258,8 @@ doit(f, fromp)
|
|||||||
pwd->pw_shell = _PATH_BSHELL;
|
pwd->pw_shell = _PATH_BSHELL;
|
||||||
if (f > 2)
|
if (f > 2)
|
||||||
(void) close(f);
|
(void) close(f);
|
||||||
|
if (setlogin(pwd->pw_name) < 0)
|
||||||
|
syslog(LOG_ERR, "setlogin() failed: %m");
|
||||||
(void) setgid((gid_t)pwd->pw_gid);
|
(void) setgid((gid_t)pwd->pw_gid);
|
||||||
initgroups(pwd->pw_name, pwd->pw_gid);
|
initgroups(pwd->pw_name, pwd->pw_gid);
|
||||||
(void) setuid((uid_t)pwd->pw_uid);
|
(void) setuid((uid_t)pwd->pw_uid);
|
||||||
|
Loading…
Reference in New Issue
Block a user