From 8ca6f0e2ac03860ba35ea0157df1176066c3f36f Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 29 Jul 1995 15:21:15 +0000 Subject: 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. --- libexec/rexecd/rexecd.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libexec/rexecd') diff --git a/libexec/rexecd/rexecd.c b/libexec/rexecd/rexecd.c index cd94b68..5fc3617 100644 --- a/libexec/rexecd/rexecd.c +++ b/libexec/rexecd/rexecd.c @@ -258,6 +258,8 @@ doit(f, fromp) pwd->pw_shell = _PATH_BSHELL; if (f > 2) (void) close(f); + if (setlogin(pwd->pw_name) < 0) + syslog(LOG_ERR, "setlogin() failed: %m"); (void) setgid((gid_t)pwd->pw_gid); initgroups(pwd->pw_name, pwd->pw_gid); (void) setuid((uid_t)pwd->pw_uid); -- cgit v1.1