-/* $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
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;
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 */
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;
# endif
#endif
- closefrom(STDERR_FILENO + 1);
-
/* Do common processing for the child, such as execing the command. */
do_child(s, command);
/* NOTREACHED */
}
+ closefrom(STDERR_FILENO + 1);
+
if (chdir(path) == -1)
fatal("Unable to chdir to chroot path \"%s\": "
"%s", path, strerror(errno));
# 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 */
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.
* Reestablish them here.
*/
if (options.use_pam) {
- do_pam_session();
do_pam_setcred(use_privsep);
}
# endif /* USE_PAM */