diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2003-08-31 13:29:06 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2003-08-31 13:29:06 +0000 |
commit | 0c85a5a50c42139bc85738d2ed7b9bff2fbbe42c (patch) | |
tree | 0924da56524e36426fbed5903d684ea8cca5da6c | |
parent | 650c1c55ea0cd58fa2c607055e82658a1c7c2ba9 (diff) |
call ssh_gssapi_storecreds conditionally from do_exec(); with sxw@inf.ed.ac.uk
-rw-r--r-- | usr.bin/ssh/session.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c index 3e9099f8bca..b5be7d1aef0 100644 --- a/usr.bin/ssh/session.c +++ b/usr.bin/ssh/session.c @@ -33,7 +33,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: session.c,v 1.162 2003/08/28 12:54:34 markus Exp $"); +RCSID("$OpenBSD: session.c,v 1.163 2003/08/31 13:29:05 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -389,12 +389,6 @@ 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 - /* Fork the child. */ if ((pid = fork()) == 0) { fatal_remove_all_cleanups(); @@ -503,12 +497,6 @@ 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 - /* Fork the child. */ if ((pid = fork()) == 0) { fatal_remove_all_cleanups(); @@ -585,6 +573,14 @@ do_exec(Session *s, const char *command) debug("Forced command '%.900s'", command); } +#ifdef GSSAPI + if (options.gss_authentication) { + temporarily_use_uid(s->pw); + ssh_gssapi_storecreds(); + restore_uid(); + } +#endif + if (s->ttyfd != -1) do_exec_pty(s, command); else |