*** src/appl/gssftp/ftpd/ftpd.c.graylist 2006-11-09 17:30:33.000000000 -0700 --- src/appl/gssftp/ftpd/ftpd.c 2006-11-09 17:40:07.000000000 -0700 *************** *** 101,106 **** --- 101,107 ---- #endif #include "pathnames.h" #include + #include #ifdef NEED_SETENV extern int setenv(char *, char *, int); *************** *** 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 *tm; + #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,638 ---- if (fcntl(fileno(stdin), F_SETOWN, getpid()) == -1) syslog(LOG_ERR, "fcntl F_SETOWN: %m"); #endif + + #if defined(__GLIBC__) + if ((tz = getenv("TZ")) == NULL) { + time_t now; + struct tm *tm; + + time(&now); + tm = localtime(&now); + + setenv("TZ", tm->tm_zone, 0); + } + #endif + dolog(&his_addr); /* * Set up default state