setproctitle setregid setreuid setrlimit \
setsid setvbuf sigaction sigvec snprintf socketpair strerror \
strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
- truncate updwtmpx utimes vhangup vsnprintf waitpid \
+ truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
)
# IRIX has a const char return value for gai_strerror()
int tcsendbreak(int, int);
#endif
+#ifndef HAVE_UNSETENV
+void unsetenv(const char *);
+#endif
+
/* wrapper for signal interface */
typedef void (*mysig_t)(int);
mysig_t mysignal(int sig, mysig_t act);
*/
#include "includes.h"
-#ifndef HAVE_SETENV
+#if !defined(HAVE_SETENV) || !defined(HAVE_UNSETENV)
#if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: setenv.c,v 1.6 2003/06/02 20:18:38 millert Exp $";
return (NULL);
}
+#ifndef HAVE_SETENV
/*
* setenv --
* Set the value of the environmental variable "name" to be
;
return (0);
}
+#endif /* HAVE_SETENV */
+#ifndef HAVE_UNSETENV
/*
* unsetenv(name) --
* Delete environmental variable "name".
if (!(*P = *(P + 1)))
break;
}
+#endif /* HAVE_UNSETENV */
-#endif /* HAVE_SETENV */
+#endif /* !defined(HAVE_SETENV) || !defined(HAVE_UNSETENV) */
SYSLOG_FACILITY_AUTH : options.log_facility,
log_stderr || !inetd_flag);
+#ifdef _AIX
+ /*
+ * Unset KRB5CCNAME, otherwise the user's session may inherit it from
+ * root's environment
+ */
+ unsetenv("KRB5CCNAME");
+#endif /* _AIX */
#ifdef _UNICOS
/* Cray can define user privs drop all prives now!
* Not needed on PRIV_SU systems!