summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-02-24 13:04:01 +1100
committerDamien Miller <djm@mindrot.org>2003-02-24 13:04:01 +1100
commit1a3ccb07c5709672d327afefd7fb6971e96b1ef7 (patch)
tree80fe70a7dd73c5271a52158f9140d147654e59f4 /session.c
parent8d8168a255c17ca343865d1ee4962f2cba46b2d8 (diff)
- (djm) Bug #494: Allow multiple accounts on Windows 9x/Me;
From vinschen@redhat.com
Diffstat (limited to 'session.c')
-rw-r--r--session.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/session.c b/session.c
index c64240cf2..a1586d3b4 100644
--- a/session.c
+++ b/session.c
@@ -1205,11 +1205,11 @@ do_nologin(struct passwd *pw)
1205void 1205void
1206do_setusercontext(struct passwd *pw) 1206do_setusercontext(struct passwd *pw)
1207{ 1207{
1208#ifdef HAVE_CYGWIN 1208#ifndef HAVE_CYGWIN
1209 if (is_winnt) { 1209 if (getuid() == 0 || geteuid() == 0)
1210#else /* HAVE_CYGWIN */
1211 if (getuid() == 0 || geteuid() == 0) {
1212#endif /* HAVE_CYGWIN */ 1210#endif /* HAVE_CYGWIN */
1211 {
1212
1213#ifdef HAVE_SETPCRED 1213#ifdef HAVE_SETPCRED
1214 setpcred(pw->pw_name); 1214 setpcred(pw->pw_name);
1215#endif /* HAVE_SETPCRED */ 1215#endif /* HAVE_SETPCRED */
@@ -1259,6 +1259,10 @@ do_setusercontext(struct passwd *pw)
1259 permanently_set_uid(pw); 1259 permanently_set_uid(pw);
1260#endif 1260#endif
1261 } 1261 }
1262
1263#ifdef HAVE_CYGWIN
1264 if (is_winnt)
1265#endif
1262 if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) 1266 if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid)
1263 fatal("Failed to set uids to %u.", (u_int) pw->pw_uid); 1267 fatal("Failed to set uids to %u.", (u_int) pw->pw_uid);
1264} 1268}