[IRCServices Coding] Chanserv patch for reg chans only
hudson at mbay.net
Wed Mar 12 19:22:51 PST 2003
On Thu, Mar 13, 2003 at 12:41:49AM +0000, Craig McLure wrote:
> Good Job, i've checked thru it quickly, and dont see any immediate probs, This will be useful for people whos IRCds dont support the ability to "forbid all channels except.." and has been requested a couple of times. it also makes enabeling new channels easier as well, although, you may wanna add is_services_oper or maybe just is_oper support as well, meaning opers or services opers can join.
That was one of the questions I had when I was working on it. I
decided on is_oper() because it seemed be used elsewhere for general
server-related exceptions - is_services_oper() only appears in
operserv. I assume it also includes is_services_admin(), but that
already has an exception above my patch so it doesn't really matter.
The other question I had was if I should depend on the result from
get_channelinfo() or get_channel() to determine if a channel is
registered. I found the code for get_channelinfo() in tools/convert-db.c,
and it seems to be a good bet for this, but I can't find the code for
get_channel() anywhere. The text shows up in channels.o, but I can't
find the code in channels.c. I feel a bit silly about this - I always
thought I was fairly good at C.
Also, I can think of a pathological case where the +b *!*@* might be a
problem. It would show up if one oper joins an unregistered channel and
idles, then a normal user tries to join and services sets the +b. With
some servers (unreal), this will prevent other opers from joining that
channel, since opers can't break bans and they can't use chanserv to
remove them, since the channel isn't registered.
This is a fairly unusual situation, but it might be more consistant if
the ban wasn't set. However, does this open services up for a DOS from
a user repeatedly trying to join and getting kicked by chanserv?