[IRCServices] Restrict access to services?

Andrew Church achurch at achurch.org
Wed Aug 22 09:28:01 PDT 2001


>     This feature is not available in the current version of Services.
>However, it has been asked for fairly frequently, and I will consider
>adding it to a future version.

     As an addendum to this, one workaround to prevent normal users from
registering channels is to modify the command table (the cmds[] array) near
the top of chanserv.c to limit the REGISTER command to Services admins
only.  The REGISTER command is listed on line 215 in version 4.5.24:

    { "REGISTER", do_register, NULL,  CHAN_HELP_REGISTER,       -1,-1,-1,-1 },

The third element in that list (NULL) is the function, if any, used to
limit access to the command.  Change it to "is_services_admin":

    { "REGISTER", do_register, is_services_admin,  CHAN_HELP_REGISTER,       -1,-1,-1,-1 },

and only Services admins will be able to use the REGISTER command--normal
users will simply get "Access denied".  You can use is_services_oper or
is_services_root instead of is_services_admin to change the OperServ access
level required for the function, though you can't allow all IRC operators
access to the command in this way without writing a new privilege-check
function for it (the "is_oper" function takes a nickname instead of a
User * parameter, so it can't be used, and "is_oper_u", which does take a
User * parameter, is a macro instead of a function).

     This method can, of course, be applied to other commands as well,
simply by changing the appropriate command table entry.  NickServ,
MemoServ, and OperServ also use command tables of the same format, located
near the top of their respective source code files (nickserv.c, memoserv.c,
and operserv.c).

     Remember to "make" and "make install" (or "gmake" and "gmake install"
depending on your system) to compile and install the new Services
executable after changing the source code.

  --Andrew Church
    achurch at achurch.org
    http://achurch.org/

>>Hi All,
>>
>>Is there any way to restrict access to services so only someone with IRC 
>>  Operator Status on the server can register new chanels?
>>
>>(If this has been asked before I appologise.. I could not find it in the 
>>archives or the readme)
>>
>>Basically, I have a web-based chatroom, which is using Bahamut as it's 
>>IRC server, and I'm running IRC Services to kepe channels for me. I 
>>don't want other users to be able to register channels or nicknames, but 
>>can't figure out how to do it.
>>
>>Any help would be much appreciated,
>>
>>Thanks,
>>
>>		Steph
>>
>>-----------------------------------------------------------
>>To unsubscribe, mail ircservices-request at ircservices.za.net
>>with the word UNSUBSCRIBE in the subject of the mail.
>>http://www.ircservices.za.net/mailman/listinfo/ircservices