From ade6a0e649fdfb15bae1ec0d86dfe5c6d691e8ee Mon Sep 17 00:00:00 2001 From: Mark Eichin Date: Mon, 13 Nov 1995 01:24:25 +0000 Subject: [PATCH] * krshd.c (doit): drag TZ= from parent environment into envinit to pass to child. (envinit, TZENV): add one more slot for optional TZ, and mark it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7089 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 6 ++++++ src/appl/bsd/krshd.c | 17 +++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 7d121ffe8..baf390dd9 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,9 @@ +Sun Nov 12 04:44:50 1995 Mark W. Eichin + + * krshd.c (doit): drag TZ= from parent environment into envinit to + pass to child. + (envinit, TZENV): add one more slot for optional TZ, and mark it. + Thu Nov 2 16:16:47 1995 Ezra Peisach * krlogin.c, krcp.c, krsh.c (main): If invoked with -D port, do diff --git a/src/appl/bsd/krshd.c b/src/appl/bsd/krshd.c index fae360648..eb760fc13 100644 --- a/src/appl/bsd/krshd.c +++ b/src/appl/bsd/krshd.c @@ -442,10 +442,12 @@ char *getenv(); #else /* CRAY */ #ifdef KERBEROS char *envinit[] = -{homedir, shell, 0, username, term, 0}; +{homedir, shell, 0, username, term, 0, 0}; +#define TZENV 5 #else /* KERBEROS */ char *envinit[] = -{homedir, shell, 0, username, term, 0}; +{homedir, shell, 0, username, term, 0, 0}; +#define TZENV 5 #endif /* KERBEROS */ #endif /* CRAY */ @@ -1229,6 +1231,17 @@ doit(f, fromp) } #endif (void) setuid((uid_t)pwd->pw_uid); + /* if TZ is set in the parent, drag it in */ + { + char **findtz = environ; + while(*findtz) { + if(!strncmp(*findtz,"TZ=",3)) { + envinit[TZENV] = *findtz; + break; + } + findtz++; + } + } environ = envinit; strncat(homedir, pwd->pw_dir, sizeof(homedir)-6); strncat(shell, pwd->pw_shell, sizeof(shell)-7); -- 2.26.2