[IRCServices] Leetle bug in Services I think (fwd)

Sotiris Tsimbonis stsimb at forthnet.gr
Tue Jan 16 23:11:23 PST 2001


On Tue, 16 Jan 2001, shadow wrote:
>      This should have been fixed in 4.4.9, but I've changed the algorithm
> for 4.5.0 to a simple counter, which should ensure uniqueness.  Hopefully
> I can get a beta of 4.5 out before too long, but for the meantime I
> suggest not using the guest-nick feature.

This counter makes it easy for somebody to guess the next nick simply by
looking at nick changes.. It's better to have an algorithm that combines
timestamp with a counter.. e.g.

in nickserv.c declare:
static int guestnum;                    /* Current guest number */

in ns_init():
        guestnum = time(NULL);
        while (guestnum>9999999) guestnum -= 10000000;

in collide():
   snprintf(guestnick, sizeof(guestnick), "%s%ld%d%ld", NSGuestNickPrefix,
            tv.tv_usec / 10000, guestnum++, tv.tv_sec % (60*60*24));

  _ _ _|_ o._ o _
 _)(_) |_ ||  |_>