X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/blobdiff_plain/00a017bdce279457abb469e72a934085beea95d7..aa56f760ea15248e3eeea92349bc5d0f27b053e3:/auth-pam.c diff --git a/auth-pam.c b/auth-pam.c index 8e9361ca..c08d4722 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -54,6 +54,7 @@ #include #include +#include #include #include @@ -436,10 +437,16 @@ sshpam_thread(void *ctxtp) u_int i; const char *pam_user; const char **ptr_pam_user = &pam_user; + char *tz = getenv("TZ"); pam_get_item(sshpam_handle, PAM_USER, (sshpam_const void **)ptr_pam_user); + environ[0] = NULL; + if (tz != NULL) + if (setenv("TZ", tz, 1) == -1) + error("PAM: could not set TZ environment: %s", + strerror(errno)); if (sshpam_authctxt != NULL) { setproctitle("%s [pam]",