diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-07-23 21:11:09 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-07-23 21:11:09 +0000 |
commit | b9051ec9a49473b81bcd50868e3367186d919fb2 (patch) | |
tree | 38751b149e1d88c0911496045e5daf6c09bf6e6b /session.c | |
parent | 3cc4450d54f7f1dab1751ba79e525a24f4f3f1b0 (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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.144 2002/07/19 15:43:33 markus Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.145 2002/07/22 11:03:06 markus Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -962,8 +962,10 @@ do_setup_env(Session *s, const char *shell) | |||
962 | child_set_env(&env, &envsize, "LOGNAME", pw->pw_name); | 962 | child_set_env(&env, &envsize, "LOGNAME", pw->pw_name); |
963 | child_set_env(&env, &envsize, "HOME", pw->pw_dir); | 963 | child_set_env(&env, &envsize, "HOME", pw->pw_dir); |
964 | #ifdef HAVE_LOGIN_CAP | 964 | #ifdef HAVE_LOGIN_CAP |
965 | (void) setusercontext(lc, pw, pw->pw_uid, LOGIN_SETPATH); | 965 | if (setusercontext(lc, pw, pw->pw_uid, LOGIN_SETPATH) < 0) |
966 | child_set_env(&env, &envsize, "PATH", getenv("PATH")); | 966 | child_set_env(&env, &envsize, "PATH", _PATH_STDPATH); |
967 | else | ||
968 | child_set_env(&env, &envsize, "PATH", getenv("PATH")); | ||
967 | #else /* HAVE_LOGIN_CAP */ | 969 | #else /* HAVE_LOGIN_CAP */ |
968 | # ifndef HAVE_CYGWIN | 970 | # ifndef HAVE_CYGWIN |
969 | /* | 971 | /* |