diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2002-06-30 19:31:10 +0000 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2002-06-30 19:31:10 +0000 |
commit | 5211a9cdb697b0a7ecdcce9ad1431c2bef0d8a96 (patch) | |
tree | d5b8e042a1e350313c70f3c383da20d82da68262 /security/hpn-ssh | |
parent | Add CGI::Session. (diff) |
give Enviroment from login.conf priority over all others,
problem found by drs@rucus.ru.ac.za.
Notes
Notes:
svn path=/head/; revision=62223
Diffstat (limited to 'security/hpn-ssh')
-rw-r--r-- | security/hpn-ssh/Makefile | 2 | ||||
-rw-r--r-- | security/hpn-ssh/files/patch-auth.c | 2 | ||||
-rw-r--r-- | security/hpn-ssh/files/patch-session.c | 44 |
3 files changed, 29 insertions, 19 deletions
diff --git a/security/hpn-ssh/Makefile b/security/hpn-ssh/Makefile index 15189725fb38..d960baeaf0ce 100644 --- a/security/hpn-ssh/Makefile +++ b/security/hpn-ssh/Makefile @@ -7,7 +7,7 @@ PORTNAME= openssh PORTVERSION= 3.4p1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= security ipv6 MASTER_SITES= ftp://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/ \ ftp://ftp.op.net/pub/OpenBSD/OpenSSH/portable/ \ diff --git a/security/hpn-ssh/files/patch-auth.c b/security/hpn-ssh/files/patch-auth.c index 20cef648ab71..7df1c76b240b 100644 --- a/security/hpn-ssh/files/patch-auth.c +++ b/security/hpn-ssh/files/patch-auth.c @@ -4,7 +4,7 @@ } #endif /* WITH_AIXAUTHENTICATE */ -+#ifdef __FreeBSD__ ++#ifdef TEST__FreeBSD__ + /* Fail if the account's expiration time has passed. */ + if (pw->pw_expire != 0) { + struct timeval tv; diff --git a/security/hpn-ssh/files/patch-session.c b/security/hpn-ssh/files/patch-session.c index b4471dce2aba..e69b0d9bc2ae 100644 --- a/security/hpn-ssh/files/patch-session.c +++ b/security/hpn-ssh/files/patch-session.c @@ -1,5 +1,5 @@ --- session.c.orig Wed Jun 26 15:51:06 2002 -+++ session.c Wed Jun 26 18:20:35 2002 ++++ session.c Sun Jun 30 21:24:32 2002 @@ -64,6 +64,13 @@ #define is_winnt (GetVersion() < 0x80000000) #endif @@ -250,9 +250,12 @@ struct passwd *pw = s->pw; /* Initialize the environment. */ -@@ -954,13 +1103,30 @@ +@@ -953,13 +1102,18 @@ + copy_environment(environ, &env, &envsize); #endif ++ if (getenv("TZ")) ++ child_set_env(&env, &envsize, "TZ", getenv("TZ")); if (!options.use_login) { +#ifdef HAVE_LOGIN_CAP + char *var; @@ -264,25 +267,32 @@ 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")); + #else /* HAVE_LOGIN_CAP */ + # ifndef HAVE_CYGWIN +@@ -984,9 +1138,19 @@ + + /* Normal systems set SHELL by default. */ + child_set_env(&env, &envsize, "SHELL", shell); ++#ifdef HAVE_LOGIN_CAP + senv = environ; + environ = xmalloc(sizeof(char *)); + *environ = NULL; -+ (void) setusercontext(lc, pw, pw->pw_uid, -+ LOGIN_SETENV|LOGIN_SETPATH); ++ if (setusercontext(lc, pw, pw->pw_uid, ++ LOGIN_SETENV|LOGIN_SETPATH) < 0) { ++ perror("unable to set user context enviroment"); ++ } + copy_environment(environ, &env, &envsize); + xfree(environ); + environ = senv; - child_set_env(&env, &envsize, "PATH", getenv("PATH")); -+ var= login_getcapstr(lc, "lang", NULL, NULL); -+ if ( var ) child_set_env(&env, &envsize, "LANG", var); -+ var= login_getcapstr(lc, "charset", NULL, NULL); -+ if ( var ) child_set_env(&env, &envsize, "MM_CHARSET", var); -+ var= login_getcapstr(lc, "timezone", NULL, NULL); -+ if ( var ) child_set_env(&env, &envsize, "TZ", var); - #else /* HAVE_LOGIN_CAP */ - # ifndef HAVE_CYGWIN - /* -@@ -1174,7 +1340,7 @@ ++#endif /* HAVE_LOGIN_CAP */ + } +- if (getenv("TZ")) +- child_set_env(&env, &envsize, "TZ", getenv("TZ")); + + /* Set custom environment options from RSA authentication. */ + if (!options.use_login) { +@@ -1174,7 +1338,7 @@ setpgid(0, 0); #endif if (setusercontext(lc, pw, pw->pw_uid, @@ -291,7 +301,7 @@ perror("unable to set user context"); exit(1); } -@@ -1325,7 +1491,7 @@ +@@ -1325,7 +1489,7 @@ * initgroups, because at least on Solaris 2.3 it leaves file * descriptors open. */ @@ -300,7 +310,7 @@ close(i); /* -@@ -1355,6 +1521,31 @@ +@@ -1355,6 +1519,31 @@ exit(1); #endif } |