diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1080,6 +1080,12 @@ do_child(const char *command, struct passwd * pw, const char *term, | |||
1080 | } | 1080 | } |
1081 | #endif | 1081 | #endif |
1082 | # else /* HAVE_LOGIN_CAP */ | 1082 | # else /* HAVE_LOGIN_CAP */ |
1083 | #if defined(HAVE_GETLUID) && defined(HAVE_SETLUID) | ||
1084 | /* Sets login uid for accounting */ | ||
1085 | if (getluid() == -1 && setluid(pw->pw_uid) == -1) | ||
1086 | error("setluid: %s", strerror(errno)); | ||
1087 | #endif /* defined(HAVE_GETLUID) && defined(HAVE_SETLUID) */ | ||
1088 | |||
1083 | if (setlogin(pw->pw_name) < 0) | 1089 | if (setlogin(pw->pw_name) < 0) |
1084 | error("setlogin failed: %s", strerror(errno)); | 1090 | error("setlogin failed: %s", strerror(errno)); |
1085 | if (setgid(pw->pw_gid) < 0) { | 1091 | if (setgid(pw->pw_gid) < 0) { |
@@ -1131,12 +1137,6 @@ do_child(const char *command, struct passwd * pw, const char *term, | |||
1131 | } | 1137 | } |
1132 | #endif /* HAVE_OSF_SIA */ | 1138 | #endif /* HAVE_OSF_SIA */ |
1133 | 1139 | ||
1134 | #if defined(HAVE_GETLUID) && defined(HAVE_SETLUID) | ||
1135 | /* Sets login uid for accounting */ | ||
1136 | if (getluid() == -1 && setluid(pw->pw_uid) == -1) | ||
1137 | error("setluid: %s", strerror(errno)); | ||
1138 | #endif /* defined(HAVE_GETLUID) && defined(HAVE_SETLUID) */ | ||
1139 | |||
1140 | #ifdef HAVE_CYGWIN | 1140 | #ifdef HAVE_CYGWIN |
1141 | if (is_winnt) | 1141 | if (is_winnt) |
1142 | #endif | 1142 | #endif |