- (bal) Corrected SCO luid patch by svaughan <svaughan@asterion.com>
diff --git a/session.c b/session.c
index d771edb..01442aa 100644
--- a/session.c
+++ b/session.c
@@ -1080,6 +1080,12 @@
 			}
 #endif
 # else /* HAVE_LOGIN_CAP */
+#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) */
+
 			if (setlogin(pw->pw_name) < 0)
 				error("setlogin failed: %s", strerror(errno));
 			if (setgid(pw->pw_gid) < 0) {
@@ -1131,12 +1137,6 @@
 		}
 #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