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

Dean Anderson dean at av8.com
Mon Jan 12 05:27:15 CET 2004


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

-------------- next part --------------
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);


More information about the Pdns-dev mailing list