summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-07-23 21:11:09 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-07-23 21:11:09 +0000
commitb9051ec9a49473b81bcd50868e3367186d919fb2 (patch)
tree38751b149e1d88c0911496045e5daf6c09bf6e6b /session.c
parent3cc4450d54f7f1dab1751ba79e525a24f4f3f1b0 (diff)
- markus@cvs.openbsd.org 2002/07/22 11:03:06
[session.c] fallback to _PATH_STDPATH on setusercontext+LOGIN_SETPATH errors;
Diffstat (limited to 'session.c')
-rw-r--r--session.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/session.c b/session.c
index 38388d43..e2e30340 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.144 2002/07/19 15:43:33 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.145 2002/07/22 11:03:06 markus Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -962,8 +962,10 @@ do_setup_env(Session *s, const char *shell)
child_set_env(&env, &envsize, "LOGNAME", pw->pw_name);
child_set_env(&env, &envsize, "HOME", pw->pw_dir);
#ifdef HAVE_LOGIN_CAP
- (void) setusercontext(lc, pw, pw->pw_uid, LOGIN_SETPATH);
- child_set_env(&env, &envsize, "PATH", getenv("PATH"));
+ if (setusercontext(lc, pw, pw->pw_uid, LOGIN_SETPATH) < 0)
+ child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
+ else
+ child_set_env(&env, &envsize, "PATH", getenv("PATH"));
#else /* HAVE_LOGIN_CAP */
# ifndef HAVE_CYGWIN
/*