summaryrefslogtreecommitdiff
path: root/auth-pam.c
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 /auth-pam.c
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@.
Diffstat (limited to 'auth-pam.c')
-rw-r--r--auth-pam.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/auth-pam.c b/auth-pam.c
index 493993a10..c08d47229 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -437,10 +437,16 @@ sshpam_thread(void *ctxtp)
437 u_int i; 437 u_int i;
438 const char *pam_user; 438 const char *pam_user;
439 const char **ptr_pam_user = &pam_user; 439 const char **ptr_pam_user = &pam_user;
440 char *tz = getenv("TZ");
440 441
441 pam_get_item(sshpam_handle, PAM_USER, 442 pam_get_item(sshpam_handle, PAM_USER,
442 (sshpam_const void **)ptr_pam_user); 443 (sshpam_const void **)ptr_pam_user);
444
443 environ[0] = NULL; 445 environ[0] = NULL;
446 if (tz != NULL)
447 if (setenv("TZ", tz, 1) == -1)
448 error("PAM: could not set TZ environment: %s",
449 strerror(errno));
444 450
445 if (sshpam_authctxt != NULL) { 451 if (sshpam_authctxt != NULL) {
446 setproctitle("%s [pam]", 452 setproctitle("%s [pam]",