[IRCServices] Re: DALnet-src: Y2K bug in the ircd (dreamforge and below)

BeenJaminG at aol.com BeenJaminG at aol.com
Sun Jan 2 10:56:42 PST 2000


In a message dated 1/2/00 9:46:16 AM Eastern Standard Time, 
andrewk at icon.co.za writes:

> Well my bug is in the date() function (s_misc.c), where the reply string
>  is generated:
>  
>          (void)sprintf(buf, "%s %s %d 19%02d -- %02d:%02d %c%02d:%02d",
>                  weekdays[lt->tm_wday], months[lt->tm_mon],lt->tm_mday,
>                  lt->tm_year, lt->tm_hour, lt->tm_min,
>                  plus, minswest/60, minswest%60);
>  
>  The "19", for the centuary, is hardcoded.
>  
>  After a very brief check, it looks like date() is only used by m_time().
>  
>  Andrew

          (void)sprintf(buf, "%s %s %d %04d -- %02d:%02d %c%02d:%02d",
                  weekdays[lt->tm_wday], months[lt->tm_mon],lt->tm_mday,
                  lt->tm_year + 1900 , lt->tm_hour, lt->tm_min,
                  plus, minswest/60, minswest%60);

I simply took out the 19 and changed the formatting to %04d, then added
1900 to the year.  I'm guessing this is going to affect a lot of people using
services who are using dalnet-compatable ircds. I wrote a little patch
yesterday for some server admins who wanted to fix the bug without
messing in their source code.
You can find it and instructions on applying it at 
http://www.mystical.net/~services/ircd/

-- bstu
---------------------------------------------------------------
To unsubscribe, send email to majordomo at ender.shadowfire.org
with "unsubscribe ircservices" in the body, without the quotes.