-#ifdef HAVE_USERSEC_H
- /* On AIX, this "sets process credentials". I am not sure what this
- includes, but it seems to be important. This also does setuid
- (but we do it below as well just in case). */
- /* XXX does chroot work after this? If not, this should be done after
- chroot (and before setuid()).*/
- if (setpcred(ssh_user_name(uc), NULL))
- SSH_DEBUG(2, ("setpcred %.100s: %.100s", strerror(errno)));
-#endif /* HAVE_USERSEC_H */
-
/* Close any extra file descriptors. Note that there may still be
descriptors left by system functions. They will be closed later. */
endpwent();
@@ -1528,6 +1518,16 @@
}
}
+#ifdef HAVE_USERSEC_H
+ /* On AIX, this "sets process credentials". I am not sure what this
+ includes, but it seems to be important. This also does setuid
+ (but we do it below as well just in case). */
+ /* XXX does chroot work after this? If not, this should be done after
+ chroot (and before setuid()). */
+ if (setpcred(ssh_user_name(uc), NULL))
+ SSH_DEBUG(2, ("setpcred %.100s: %.100s", strerror(errno)));
+#endif /* HAVE_USERSEC_H */
+
#ifdef HAVE_SIA
#ifdef SSHDIST_SESSION_SIA
/* Temporarily switch to the desired uid. We'll permanently switch