summaryrefslogtreecommitdiffstats
path: root/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'session.c')
-rw-r--r--session.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/session.c b/session.c
index 3593a3ff..6ba0233e 100644
--- a/session.c
+++ b/session.c
@@ -418,6 +418,12 @@ do_exec_no_pty(Session *s, const char *command)
session_proctitle(s);
+#ifdef GSSAPI
+ temporarily_use_uid(s->pw);
+ ssh_gssapi_storecreds();
+ restore_uid();
+#endif
+
#if defined(USE_PAM)
if (options.use_pam) {
do_pam_session(s->pw->pw_name, NULL);
@@ -428,12 +434,6 @@ do_exec_no_pty(Session *s, const char *command)
}
#endif /* USE_PAM */
-#ifdef GSSAPI
- temporarily_use_uid(s->pw);
- ssh_gssapi_storecreds();
- restore_uid();
-#endif
-
/* Fork the child. */
if ((pid = fork()) == 0) {
fatal_remove_all_cleanups();
@@ -553,6 +553,12 @@ do_exec_pty(Session *s, const char *command)
ptyfd = s->ptyfd;
ttyfd = s->ttyfd;
+#ifdef GSSAPI
+ temporarily_use_uid(s->pw);
+ ssh_gssapi_storecreds();
+ restore_uid();
+#endif
+
#if defined(USE_PAM)
if (options.use_pam) {
do_pam_session(s->pw->pw_name, s->tty);
@@ -560,12 +566,6 @@ do_exec_pty(Session *s, const char *command)
}
#endif
-#ifdef GSSAPI
- temporarily_use_uid(s->pw);
- ssh_gssapi_storecreds();
- restore_uid();
-#endif
-
/* Fork the child. */
if ((pid = fork()) == 0) {
fatal_remove_all_cleanups();