Issues w/ timezones on gssftpd

Philip Prindeville philipp at redfish-solutions.com
Wed Nov 22 14:51:01 EST 2006


Can someone please explain to me (offline if need be) why this request
didn't warrant a response?

That way, I won't waste your time again.

Thanks,

-Philip

Philip Prindeville wrote:

>Doh.  That fix below doesn't work with daylight savings time.
>
>Came up with a simpler fix.
>
>Attached as a patch.
>
>-Philip
>
>
>[snip]
>
>------------------------------------------------------------------------
>
>*** 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 <libpty.h>
>+ #include <time.h>
>  
>  #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
>  
>




More information about the krbdev mailing list