diff options
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.h | 6 | ||||
-rw-r--r-- | openbsd-compat/setenv.c | 8 | ||||
-rw-r--r-- | sshd.c | 7 |
4 files changed, 20 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index fc765b472..8eea75589 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.204 2004/03/03 00:08:59 djm Exp $ | 1 | # $Id: configure.ac,v 1.205 2004/03/08 11:59:03 dtucker Exp $ |
2 | 2 | ||
3 | AC_INIT | 3 | AC_INIT |
4 | AC_CONFIG_SRCDIR([ssh.c]) | 4 | AC_CONFIG_SRCDIR([ssh.c]) |
@@ -802,7 +802,7 @@ AC_CHECK_FUNCS(\ | |||
802 | setproctitle setregid setreuid setrlimit \ | 802 | setproctitle setregid setreuid setrlimit \ |
803 | setsid setvbuf sigaction sigvec snprintf socketpair strerror \ | 803 | setsid setvbuf sigaction sigvec snprintf socketpair strerror \ |
804 | strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \ | 804 | strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \ |
805 | truncate updwtmpx utimes vhangup vsnprintf waitpid \ | 805 | truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \ |
806 | ) | 806 | ) |
807 | 807 | ||
808 | # IRIX has a const char return value for gai_strerror() | 808 | # IRIX has a const char return value for gai_strerror() |
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index c8073942c..009739b14 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: bsd-misc.h,v 1.14 2004/02/17 05:49:55 djm Exp $ */ | 1 | /* $Id: bsd-misc.h,v 1.15 2004/03/08 11:59:03 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org> | 4 | * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org> |
@@ -89,6 +89,10 @@ pid_t tcgetpgrp(int); | |||
89 | int tcsendbreak(int, int); | 89 | int tcsendbreak(int, int); |
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | #ifndef HAVE_UNSETENV | ||
93 | void unsetenv(const char *); | ||
94 | #endif | ||
95 | |||
92 | /* wrapper for signal interface */ | 96 | /* wrapper for signal interface */ |
93 | typedef void (*mysig_t)(int); | 97 | typedef void (*mysig_t)(int); |
94 | mysig_t mysignal(int sig, mysig_t act); | 98 | mysig_t mysignal(int sig, mysig_t act); |
diff --git a/openbsd-compat/setenv.c b/openbsd-compat/setenv.c index b7ba0ce83..c3a86c651 100644 --- a/openbsd-compat/setenv.c +++ b/openbsd-compat/setenv.c | |||
@@ -30,7 +30,7 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include "includes.h" | 32 | #include "includes.h" |
33 | #ifndef HAVE_SETENV | 33 | #if !defined(HAVE_SETENV) || !defined(HAVE_UNSETENV) |
34 | 34 | ||
35 | #if defined(LIBC_SCCS) && !defined(lint) | 35 | #if defined(LIBC_SCCS) && !defined(lint) |
36 | static char *rcsid = "$OpenBSD: setenv.c,v 1.6 2003/06/02 20:18:38 millert Exp $"; | 36 | static char *rcsid = "$OpenBSD: setenv.c,v 1.6 2003/06/02 20:18:38 millert Exp $"; |
@@ -77,6 +77,7 @@ __findenv(name, offset) | |||
77 | return (NULL); | 77 | return (NULL); |
78 | } | 78 | } |
79 | 79 | ||
80 | #ifndef HAVE_SETENV | ||
80 | /* | 81 | /* |
81 | * setenv -- | 82 | * setenv -- |
82 | * Set the value of the environmental variable "name" to be | 83 | * Set the value of the environmental variable "name" to be |
@@ -138,7 +139,9 @@ setenv(name, value, rewrite) | |||
138 | ; | 139 | ; |
139 | return (0); | 140 | return (0); |
140 | } | 141 | } |
142 | #endif /* HAVE_SETENV */ | ||
141 | 143 | ||
144 | #ifndef HAVE_UNSETENV | ||
142 | /* | 145 | /* |
143 | * unsetenv(name) -- | 146 | * unsetenv(name) -- |
144 | * Delete environmental variable "name". | 147 | * Delete environmental variable "name". |
@@ -157,5 +160,6 @@ unsetenv(name) | |||
157 | if (!(*P = *(P + 1))) | 160 | if (!(*P = *(P + 1))) |
158 | break; | 161 | break; |
159 | } | 162 | } |
163 | #endif /* HAVE_UNSETENV */ | ||
160 | 164 | ||
161 | #endif /* HAVE_SETENV */ | 165 | #endif /* !defined(HAVE_SETENV) || !defined(HAVE_UNSETENV) */ |
@@ -939,6 +939,13 @@ main(int ac, char **av) | |||
939 | SYSLOG_FACILITY_AUTH : options.log_facility, | 939 | SYSLOG_FACILITY_AUTH : options.log_facility, |
940 | log_stderr || !inetd_flag); | 940 | log_stderr || !inetd_flag); |
941 | 941 | ||
942 | #ifdef _AIX | ||
943 | /* | ||
944 | * Unset KRB5CCNAME, otherwise the user's session may inherit it from | ||
945 | * root's environment | ||
946 | */ | ||
947 | unsetenv("KRB5CCNAME"); | ||
948 | #endif /* _AIX */ | ||
942 | #ifdef _UNICOS | 949 | #ifdef _UNICOS |
943 | /* Cray can define user privs drop all prives now! | 950 | /* Cray can define user privs drop all prives now! |
944 | * Not needed on PRIV_SU systems! | 951 | * Not needed on PRIV_SU systems! |