]> andersk Git - openssh.git/blobdiff - session.c
- (tim) [regress/sftp-cmds.sh regress/ssh2putty.sh] Shell portability fixes
[openssh.git] / session.c
index 7a97ae8d6a54da95ad01e6a2243405e954e673dd..f5eaa815caa980c8442f4e74f142198ee890acb6 100644 (file)
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.229 2008/02/20 15:25:26 markus Exp $ */
+/* $OpenBSD: session.c,v 1.230 2008/02/22 05:58:56 djm Exp $ */
 /*
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
@@ -428,11 +428,6 @@ do_exec_no_pty(Session *s, const char *command)
 
        session_proctitle(s);
 
-#if defined(USE_PAM)
-       if (options.use_pam && !use_privsep)
-               do_pam_setcred(1);
-#endif /* USE_PAM */
-
        /* Fork the child. */
        if ((pid = fork()) == 0) {
                is_child = 1;
@@ -488,8 +483,6 @@ do_exec_no_pty(Session *s, const char *command)
                cray_init_job(s->pw); /* set up cray jid and tmpdir */
 #endif
 
-               closefrom(STDERR_FILENO + 1);
-
                /* Do processing for the child (exec command etc). */
                do_child(s, command);
                /* NOTREACHED */
@@ -565,14 +558,6 @@ do_exec_pty(Session *s, const char *command)
        ptyfd = s->ptyfd;
        ttyfd = s->ttyfd;
 
-#if defined(USE_PAM)
-       if (options.use_pam) {
-               do_pam_set_tty(s->tty);
-               if (!use_privsep)
-                       do_pam_setcred(1);
-       }
-#endif
-
        /* Fork the child. */
        if ((pid = fork()) == 0) {
                is_child = 1;
@@ -610,8 +595,6 @@ do_exec_pty(Session *s, const char *command)
 # endif
 #endif
 
-               closefrom(STDERR_FILENO + 1);
-
                /* Do common processing for the child, such as execing the command. */
                do_child(s, command);
                /* NOTREACHED */
@@ -1345,6 +1328,8 @@ safely_chroot(const char *path, uid_t uid)
 
        }
 
+       closefrom(STDERR_FILENO + 1);
+
        if (chdir(path) == -1)
                fatal("Unable to chdir to chroot path \"%s\": "
                    "%s", path, strerror(errno));
@@ -1375,16 +1360,8 @@ do_setusercontext(struct passwd *pw)
 # ifdef __bsdi__
                setpgid(0, 0);
 # endif
-#ifdef GSSAPI
-               if (options.gss_authentication) {
-                       temporarily_use_uid(pw);
-                       ssh_gssapi_storecreds();
-                       restore_uid();
-               }
-#endif
 # ifdef USE_PAM
                if (options.use_pam) {
-                       do_pam_session();
                        do_pam_setcred(use_privsep);
                }
 # endif /* USE_PAM */
@@ -1412,13 +1389,6 @@ do_setusercontext(struct passwd *pw)
                        exit(1);
                }
                endgrent();
-# ifdef GSSAPI
-               if (options.gss_authentication) {
-                       temporarily_use_uid(pw);
-                       ssh_gssapi_storecreds();
-                       restore_uid();
-               }
-# endif
 # ifdef USE_PAM
                /*
                 * PAM credentials may take the form of supplementary groups.
@@ -1426,7 +1396,6 @@ do_setusercontext(struct passwd *pw)
                 * Reestablish them here.
                 */
                if (options.use_pam) {
-                       do_pam_session();
                        do_pam_setcred(use_privsep);
                }
 # endif /* USE_PAM */
This page took 0.035514 seconds and 4 git commands to generate.