summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
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 c64240cf..a1586d3b 100644
--- a/session.c
+++ b/session.c
@@ -1205,11 +1205,11 @@ do_nologin(struct passwd *pw)
void
do_setusercontext(struct passwd *pw)
{
-#ifdef HAVE_CYGWIN
- if (is_winnt) {
-#else /* HAVE_CYGWIN */
- if (getuid() == 0 || geteuid() == 0) {
+#ifndef HAVE_CYGWIN
+ if (getuid() == 0 || geteuid() == 0)
#endif /* HAVE_CYGWIN */
+ {
+
#ifdef HAVE_SETPCRED
setpcred(pw->pw_name);
#endif /* HAVE_SETPCRED */
@@ -1259,6 +1259,10 @@ do_setusercontext(struct passwd *pw)
permanently_set_uid(pw);
#endif
}
+
+#ifdef HAVE_CYGWIN
+ if (is_winnt)
+#endif
if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid)
fatal("Failed to set uids to %u.", (u_int) pw->pw_uid);
}