[IRCServices] Leetle bug in Services I think

Sean Kelly smkelly at zombie.org
Mon Jan 15 10:59:23 PST 2001


On Mon, Jan 15, 2001 at 08:43:03PM +0200, Michael Smith wrote:
> 
> Err its a twofold problem
> 
> Dreamforge's svsnick doesnt check to see that the nick isnt already in use
> AND , the code in services doesnt generate a different number per unique
> instance use, so its probably based on some kind of time stamp
> 
> I have coded a fix for dreamforge, but I'm not sure how badly this will
> break servicse

I'd be interrested to see the patch.

> 
> BTW, does anyone have that patch for multiple services root, I am keen for that
> (and It should be a feature in 4.5)

Well, this isn't services-coding, but what the hell:

From: "Kelmar K. Firesun" <kfiresun at ix.netcom.com>
To: <services at dragonfire.net>
Subject: Re: Services Root(s)

One way you can do this is to add a kludge to
the is_services_root() in the file operserv.c
function like so:

/*************************************************************************/

/* Does the given user have Services root privileges? */

int is_services_root(User *u)
{
    char s[512], *p, *c;

    /* Make a temp copy to work with */
    strcpy(s, ServicesRoot);

    c = s;

    while(*c)
    {
        p = strpbrk(c, " ");

        if (p != NULL)
        {
            *p++ = 0;
            while(isspace(*p)) p++;
        }
        else
            p = c + strlen(c);

        if (stricmp(u->nick, c) == 0)
            return 1;

        c = p;
    }

    return 0;
}

/* End of modification */

This will allow you to sperate the root users
by a space in the config file like so:

ServicesRoot "User1 User2 ... UserN"

Hope this helps!

Kelmar K. Firesun
IRCop EsperNet (kelmar at esper.net)
dream.esper.net port 5555


-- 
Sean Kelly         | PGP KeyID: 77042C7B
smkelly at zombie.org | http://www.zombie.org

For PGP key, send e-mail with subject "send pgp key"

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