diff options
author | Damien Miller <djm@mindrot.org> | 2001-02-16 12:12:41 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2001-02-16 12:12:41 +1100 |
commit | 217f567187a9b1d32019666151d702c87332c72b (patch) | |
tree | faa72af41f566ce6ba47cb1540c7a757e02a7333 /session.c | |
parent | 5dfe976cdfbc5703dfbbd0783f1328be0007eca3 (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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -881,7 +881,6 @@ void do_pam_environment(char ***env, int *envsize) | |||
881 | } | 881 | } |
882 | #endif /* USE_PAM */ | 882 | #endif /* USE_PAM */ |
883 | 883 | ||
884 | |||
885 | #ifdef HAVE_CYGWIN | 884 | #ifdef HAVE_CYGWIN |
886 | void copy_environment(char ***env, int *envsize) | 885 | void copy_environment(char ***env, int *envsize) |
887 | { | 886 | { |
@@ -1118,6 +1117,12 @@ do_child(const char *command, struct passwd * pw, const char *term, | |||
1118 | } | 1117 | } |
1119 | #endif /* HAVE_OSF_SIA */ | 1118 | #endif /* HAVE_OSF_SIA */ |
1120 | 1119 | ||
1120 | #if defined(HAVE_GETLUID) && defined(HAVE_SETLUID) | ||
1121 | /* Sets login uid for accounting */ | ||
1122 | if (getluid() == -1 && setluid(pw->pw_uid) == -1) | ||
1123 | error("setluid: %s", strerror(errno)); | ||
1124 | #endif /* defined(HAVE_GETLUID) && defined(HAVE_SETLUID) */ | ||
1125 | |||
1121 | #ifdef HAVE_CYGWIN | 1126 | #ifdef HAVE_CYGWIN |
1122 | if (is_winnt) | 1127 | if (is_winnt) |
1123 | #endif | 1128 | #endif |