From: dtucker Date: Sun, 17 Sep 2006 01:57:46 +0000 (+0000) Subject: - (dtucker) [auth-pam.c] Propogate TZ environment variable to PAM auth X-Git-Tag: V_4_4_P1~16 X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/commitdiff_plain/3fd7b98a509a74d9fa4e87d1cf8489c6a9715ebb - (dtucker) [auth-pam.c] Propogate TZ environment variable to PAM auth process so that any logging it does is with the right timezone. From Scott Strickler, ok djm@. --- diff --git a/ChangeLog b/ChangeLog index 994c2936..bd47ad48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ problem reported by Tavis Ormandy, Google Security Team; ok markus@ deraadt@ - (djm) Add openssh.xml to .cvsignore and sort it + - (dtucker) [auth-pam.c] Propogate TZ environment variable to PAM auth + process so that any logging it does is with the right timezone. From + Scott Strickler, ok djm@. 20060912 - (djm) [Makefile.in buildpkg.sh.in configure.ac openssh.xml.in] diff --git a/auth-pam.c b/auth-pam.c index 493993a1..c08d4722 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -437,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]",