summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2006-09-17 11:57:46 +1000
committerDarren Tucker <dtucker@zip.com.au>2006-09-17 11:57:46 +1000
commit54e1b2291cf5fcd96ba36d291e6543eab44ec4dd (patch)
tree51eef2ca6c456b0b05018c29a371b682cbde11f9
parentdd1f9b307eb0ab746a9cbd391511dbf646f29210 (diff)
- (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@.
-rw-r--r--ChangeLog5
-rw-r--r--auth-pam.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 31037571..48de6b1c 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]
@@ -5442,4 +5445,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
-$Id: ChangeLog,v 1.4546 2006/09/16 22:05:03 djm Exp $
+$Id: ChangeLog,v 1.4547 2006/09/17 01:57:46 dtucker Exp $
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]",