[Pdns-dev] Serious Time bug for Bind Backend Slaves

bert hubert ahu at ds9a.nl
Mon Jan 12 12:07:26 CET 2004


Thanks Dean, but we knew. The work is much appreciated though.

Patch was in since a few hours after the event.

On Mon, Jan 12, 2004 at 05:27:15AM -0500, Dean Anderson wrote:
> Good morning everyone,
> 
> Little did anyone notice, but Unix just went over the hill.
> 
> On Jan 10, 2004 at 8:37:04, unix time passed 2^31, the halfway point to 
> 2^32 - 1 seconds since Jan 1, 1970, which is in 2038.  What a short 34 
> years its been.
> 
> Anyway, there is a bug in pdns/communicator.hh which has an incorrect 
> INT_MAX calculation. I've included a short patch to fix it.  INT_MAX works 
> much better than 1<<31 - 1, which isn't what was wanted anyway.
> 
> The symptom is that bind slave backends won't do zone transfers anymore. 
> 
> I'm using 2.9.11, but unless this was fixed and I missed it, it is still a 
> problem in latest...  Enjoy.
> 
> 		--Dean
> 
> import time
> >>> time.ctime(1073741824)
> 'Sat Jan 10 08:37:04 2004'
> >>> time.ctime(1073899597)
> 'Mon Jan 12 04:26:37 2004'
> >>> print "%x" % 1073741824
> 40000000
> 

Content-Description: time patch
> diff -r -u pdns-2.9.11.orig/pdns/communicator.hh pdns-2.9.11/pdns/communicator.hh
> --- pdns-2.9.11.orig/pdns/communicator.hh	Sat Jun 21 06:04:32 2003
> +++ pdns-2.9.11/pdns/communicator.hh	Mon Jan 12 05:06:42 2004
> @@ -94,7 +94,8 @@
>    
>    time_t earliest()
>    {
> -    time_t early=1<<31-1; // y2038 problem lurking here :-)
> +    //time_t early=1<<31-1; // y2038 problem lurking here :-)
> +    time_t early=INT_MAX;
>      for(d_nqueue_t::const_iterator i=d_nqueue.begin();i!=d_nqueue.end();++i) 
>        early=min(early,i->next);
>      return early-time(0);

> _______________________________________________
> Pdns-dev mailing list
> Pdns-dev at mailman.powerdns.com
> http://mailman.powerdns.com/mailman/listinfo/pdns-dev


-- 
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://lartc.org           Linux Advanced Routing & Traffic Control HOWTO


More information about the Pdns-dev mailing list