summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-02-16 12:12:41 +1100
committerDamien Miller <djm@mindrot.org>2001-02-16 12:12:41 +1100
commit217f567187a9b1d32019666151d702c87332c72b (patch)
treefaa72af41f566ce6ba47cb1540c7a757e02a7333 /session.c
parent5dfe976cdfbc5703dfbbd0783f1328be0007eca3 (diff)
- (djm) Set "login ID" on systems with setluid. Only enabled for SCO
OpenServer for now. Based on patch from svaughan <svaughan@asterion.com>
Diffstat (limited to 'session.c')
-rw-r--r--session.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/session.c b/session.c
index 8f3ee834..47ef8b9c 100644
--- a/session.c
+++ b/session.c
@@ -881,7 +881,6 @@ void do_pam_environment(char ***env, int *envsize)
}
#endif /* USE_PAM */
-
#ifdef HAVE_CYGWIN
void copy_environment(char ***env, int *envsize)
{
@@ -1118,6 +1117,12 @@ do_child(const char *command, struct passwd * pw, const char *term,
}
#endif /* HAVE_OSF_SIA */
+#if defined(HAVE_GETLUID) && defined(HAVE_SETLUID)
+ /* Sets login uid for accounting */
+ if (getluid() == -1 && setluid(pw->pw_uid) == -1)
+ error("setluid: %s", strerror(errno));
+#endif /* defined(HAVE_GETLUID) && defined(HAVE_SETLUID) */
+
#ifdef HAVE_CYGWIN
if (is_winnt)
#endif