Issues w/ timezones on gssftpd
Philip Prindeville
philipp at redfish-solutions.com
Thu Nov 9 23:30:21 EST 2006
And the winner is:
***************
*** 293,303 ****
int addrlen, c, on = 1, tos, port = -1;
extern char *optarg;
extern int optopt;
#ifdef KRB5_KRB4_COMPAT
char *option_string = "AaCcdElp:r:s:T:t:U:u:vw:";
#else /* !KRB5_KRB4_COMPAT */
char *option_string = "AaCcdElp:r:T:t:U:u:vw:";
#endif /* KRB5_KRB4_COMPAT */
ftpusers = _PATH_FTPUSERS_DEFAULT;
#ifdef KRB5_KRB4_COMPAT
--- 293,306 ----
int addrlen, c, on = 1, tos, port = -1;
extern char *optarg;
extern int optopt;
+ #if defined(__GLIBC__)
+ char *tz;
+ #endif
#ifdef KRB5_KRB4_COMPAT
char *option_string = "AaCcdElp:r:s:T:t:U:u:vw:";
#else /* !KRB5_KRB4_COMPAT */
char *option_string = "AaCcdElp:r:T:t:U:u:vw:";
#endif /* KRB5_KRB4_COMPAT */
ftpusers = _PATH_FTPUSERS_DEFAULT;
#ifdef KRB5_KRB4_COMPAT
***************
*** 536,541 ****
--- 620,633 ----
if (fcntl(fileno(stdin), F_SETOWN, getpid()) == -1)
syslog(LOG_ERR, "fcntl F_SETOWN: %m");
#endif
+
+ #if defined(__GLIBC__)
+ if ((tz = getenv("TZ")) == NULL) {
+ tzset();
+ setenv("TZ", tzname[0], 0);
+ }
+ #endif
+
dolog(&his_addr);
/*
* Set up default state
Can we slip this in?
BTW: No chance of my graylisting patch making it, huh?
-Philip
Philip Prindeville wrote:
>Howdy,
>
>I'm running krb5-workstation-1.4.3-5.1 on FC5, and seeing:
>
>Oct 30 09:09:14 mail ftpd[9129]: connection from 62.101.42.1 () at Mon Oct 30 09:09:14 2006
>Oct 30 09:09:14 mail ftpd[9129]: ANONYMOUS FTP LOGIN FROM 62.101.42.1, (IEUser@)
>Oct 30 16:09:15 mail ftpd[9129]: get /pub/915resolution-0.5.2-3.src.rpm
>
>
>I'm in the Mountain timezone (GMT -0700). It looks like the ftpd
>that is getting forked off and chroot()ing to ~ftp/ is either zapping
>its environment or else losing access to some system file that gives
>the timezone and time offset.
>
>I haven't dug into glibc and what the /etc/localtime file does... but
>I'm guessing that this might need to be copied into the ~ftp/etc/
>directory. Is that correct?
>
>Or can ftpd simple export the current timezone via the setenv(TZ, ...)
>or tweaking the value of extern char *tzname[2]?
>
>I'll stare at it for a while, and see if I can come up with a fix... It
>might be as simple as calling localtime() and discarding the return value
>before calling chroot().
>
>Thanks,
>
>-Philip
>
>
>
>
>
More information about the krbdev
mailing list