From: Entrope Date: Sat, 28 Feb 2004 19:08:13 +0000 (+0000) Subject: Fix bugs found on GameSurge X-Git-Tag: v1.4.0-rc1~265 X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=96f2ccb2f360c0d2cee1f1f35d7993bef03ff6bf;p=srvx.git Fix bugs found on GameSurge * Remove unused ARCH_REVISION macro in Makefile.am * Fix !trim (so it does not trim ALL users) * Properly allow owners to set levels to 501 * Set "deopped" when we deop the person who changed modes * Mark the first user in a channel as a chanop (fixes a spurious HACK(4) for newly registered channels). * Document user level ranges for the TRIM command. * Document user-level-based SET options as being such (rather than being multiple-choice options). git-archimport-id: srvx@srvx.net--2004-srvx/srvx--devo--1.3--patch-11 --- diff --git a/src/Makefile.am b/src/Makefile.am index 68b6804..c31f287 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,6 @@ AM_CPPFLAGS = @RX_INCLUDES@ LIBS = @LIBS@ @RX_LIBS@ -ARCH_REVISION=$(shell tla logs -f | tail -n 1) noinst_PROGRAMS = srvx EXTRA_PROGRAMS = checkdb globtest noinst_DATA = chanserv.help global.help modcmd.help nickserv.help opserv.help saxdb.help sendmail.help mod-sockcheck.help mod-helpserv.help mod-memoserv.help diff --git a/src/chanserv.c b/src/chanserv.c index b5e3d1e..1da6863 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -2406,7 +2406,7 @@ cmd_trim_users(struct userNode *user, struct chanNode *channel, unsigned short m continue; if(((uData->access >= min_access) && (uData->access <= max_access)) - || (max_access && (uData->access < actor->access))) + || (!max_access && (uData->access < actor->access))) { del_channel_user(uData, 1); count++; @@ -4947,7 +4947,7 @@ channel_level_option(enum levelOption option, struct userNode *user, struct chan return 0; } uData = GetChannelUser(cData, user->handle_info); - if(!uData || (uData->access < value)) + if(!uData) { reply("CSMSG_BAD_SETLEVEL"); return 0; @@ -6000,6 +6000,7 @@ handle_mode(struct chanNode *channel, struct userNode *user, const struct mod_ch bounce->args[bnc].member = GetUserMode(channel, user); if(bounce->args[bnc].member) bnc++; + deopped = 1; } bounce->args[bnc].mode = MODE_CHANOP; bounce->args[bnc].member = change->args[ii].member; diff --git a/src/chanserv.help b/src/chanserv.help index 1e9ccd0..2971dc1 100644 --- a/src/chanserv.help +++ b/src/chanserv.help @@ -309,8 +309,8 @@ "USERGREETING: A greeting message for users on the channel's userlist.", "MODES: The channel's default modes.", "PUBCMD: Restrictions to use commands in public.", - "STRICTOP: Restrictions for opping users.", - "AUTOOP: The users that $b$C$b will autoop.", + "GIVEOPS: The users that $b$C$b will autoop.", + "ENFOPS: Restrictions for opping users.", "ENFMODES: Restrictions to change the default modes.", "ENFTOPIC: Restrictions on changing the topic.", "PROTECT: The protection level $b$C$b provides.", @@ -327,7 +327,7 @@ "$bIRCOP ONLY$b:", "NODELETE: Prevents channel deletion.", "If you wish to reset your channel to the default settings, you can use the $bSET DEFAULTS$b command.", - "$uSee Also:$u set pubcmd, set strictop, set autoop, set enfmodes, set enftopic, set protect, set toys, set setters, set topicrefresh, set ctcpusers, set ctcpreaction, set defaults"); + "$uSee Also:$u set pubcmd, set giveops, set enfops, set enfmodes, set enftopic, set protect, set toys, set setters, set topicrefresh, set ctcpusers, set ctcpreaction, set defaults"); "SET DEFAULTTOPIC" ("/msg $C SET <#channel> DEFAULTTOPIC ", "This changes the default topic for the channel. $C will set the IRC topic to this value when the $btopic$b command is used with no arguments, when the topic refresh happens (if you have $bset topicrefresh$b), or when an unauthorized user changes the topic to something else.", "$uSee Also:$u set, set topicrefresh, set enftopic, set topicmask"); @@ -344,50 +344,19 @@ "$b2$b Toys will reply publicly.", "$uSee Also:$u set"); "SET PUBCMD" ("/msg $C SET <#channel> PUBCMD ", - "This setting restricts the access necessary to use in-channel commands. Valid settings are:", - "$b0$b Anyone may use public commands", - "$b1$b Peons and above may use public commands", - "$b2$b Ops and above may use public commands", - "$b3$b Masters and above may use public commands", - "$b4$b Coowners and above may use public commands", - "$b5$b Only owners may use public commands", - "$b6$b No one may use public commands", + "This setting restricts the access necessary to use in-channel commands. It is a numeric user level, or 501 to mean no one may use public commands.", "$uSee Also:$u set"); -"SET STRICTOP" ("/msg $C SET <#channel> STRICTOP ", - "This setting restricts who may op users who are not at least ops on the userlist. If $C sees someone with access below the specified access op someone not on the userlist (or who is a peon), it will deop the second user. Valid settings are:", - "$b0$b Anyone may op unknown users", - "$b1$b Ops and above may op unknown users", - "$b2$b Masters and above may op unknown users", - "$b3$b Coowners and above may op unknown users", - "$b4$b Only owners may op unknown users", - "$b5$b No one may op unknown users", +"SET ENFOPS" ("/msg $C SET <#channel> ENFOPS ", + "This setting restricts who may op users who are not at least ops on the userlist. If $C sees someone with access below the specified access op someone not on the userlist (or who is a peon), it will deop the second user. It is a numeric user level, or 501 to mean no one may op unrecognized users.", "$uSee Also:$u set"); -"SET AUTOOP" ("/msg $C SET <#channel> AUTOOP ", - "This setting restricts the minimum access someone must be to be automatically op'ed by $C. Valid settings are:", - "$b0$b Everyone will be automatically op'ed", - "$b1$b Ops and above will be automatically op'ed", - "$b2$b Masters and above will be automatically op'ed", - "$b3$b Coowners and above will be automatically op'ed", - "$b4$b Only owners will be automatically op'ed", - "$b5$b No one will be automatically op'ed", +"SET GIVEOPS" ("/msg $C SET <#channel> GIVEOPS ", + "This setting restricts the minimum access someone must be to be automatically op'ed by $C. It is a numeric user level.", "$uSee Also:$u set"); "SET ENFMODES" ("/msg $C SET <#channel> ENFMODES ", - "This setting restricts the minimum access someone must have to change the channel modes from what is specified in the channel settings. Valid settings are:", - "$b0$b Anyone may override the mode lock", - "$b1$b Ops and above may override the mode lock", - "$b2$b Masters and above may override the mode lock", - "$b3$b Coowners and above may override the mode lock", - "$b4$b Only owners may override the mode lock", - "$b5$b No one may override the mode lock", + "This setting restricts the minimum access someone must have to change the channel modes from what is specified in the channel settings. It is a numeric user level, or 501 to mean no one may override the default modes.", "$uSee Also:$u set"); "SET ENFTOPIC" ("/msg $C SET <#channel> ENFTOPIC ", - "This setting restricts the minimum access someone must have to change the channel topic. Valid settings are:", - "$b0$b Anyone may change the topic", - "$b1$b Ops and above may change the topic", - "$b2$b Masters and above may change the topic", - "$b3$b Coowners and above may change the topic", - "$b4$b Only owners may change the topic", - "$b5$b No one may change the topic", + "This setting restricts the minimum access someone must have to change the channel topic. It is a numeric user level, or 501 to mean no one may override the default topic.", "If a topic mask is set, then a person may change the topic as long as it matches that mask $bor$b they have the above access.", "If no topic mask is set, then a person must have the above access to change the topic from the default.", "$uSee Also:$u set, set topic, set topicmask"); @@ -399,10 +368,7 @@ "$b3$b No users will be protected.", "$uSee Also:$u set"); "SET SETTERS" ("/msg $C SET <#channel> SETTERS ", - "This setting restricts the protection that $C enforces. Valid settings are:", - "$b0$b Masters and above may change settings.", - "$b1$b Co-owners and above may change settings.", - "$b2$b Only owners may change settings.", + "This setting restricts the protection that $C enforces. It is a numeric user level.", "$uSee Also:$u set"); "SET TOPICREFRESH" ("/msg $C SET <#channel> TOPICREFRESH ", "This setting controls if (and how often) $C refreshes the topic to the default value. Valid settings are:", @@ -413,14 +379,7 @@ "$b4$b Refresh every 24 hours.", "$uSee Also:$u set, set topic"); "SET CTCPUSERS" ("/msg $C SET <#channel> CTCPUSERS ", - "This setting controls who is allowed to send CTCPs to the channel. CTCP ACTION, the way that /me is implemented, are always allowed:", - "$b0$b Anyone may send CTCPs to the channel.", - "$b1$b Peons and above may send CTCPs to the channel.", - "$b2$b Ops and above may send CTCPs to the channel.", - "$b3$b Masters and above may send CTCPs to the channel.", - "$b4$b Coowners and above may send CTCPs to the channel.", - "$b5$b Owners may send CTCPs to the channel.", - "$b6$b No one may send CTCPs to the channel.", + "This setting controls who is allowed to send CTCPs to the channel. CTCP ACTION, the way that /me is implemented, are always allowed. For any other CTCP, the user must have this access level. 501 indicates no users may use CTCPs in the channel.", "If a user below the specified level sends a CTCP (besides ACTION) to the channel, the enforcement is specified by the $bCTCPReaction$b setting.", "$uSee Also:$u set, set ctcpreaction"); "SET CTCPREACTION" ("/msg $C SET <#channel> CTCPREACTION ", @@ -443,7 +402,7 @@ "TOPIC" ("/msg $C TOPIC <#channel> [topic]", "Sets the current topic for the specified channel. If no topic is specified, then set the current topic to the default topic."); "TRIM" ("/msg $C TRIM <#channel> ", - "The trim command removes target objects inactive for more than a certain duration from a channel. The target must be a channel access level, \"users\", or \"bans\". The duration argument specifies the amount of time the target has been inactive for to be removed.", + "The trim command removes target objects inactive for more than a certain duration from a channel. The target must be a channel access level, a range of access levels (for example, \"300-399\"), \"users\" or \"bans\". The duration argument specifies the amount of time the target has been inactive for to be removed.", "$uSee Also:$u durations"); "UNBAN" ("/msg $C UNBAN <#channel> ", "Unbans the specified nick or hostmask. If a nick is given, $b$C$b determines what hostmask(s) to unban.", diff --git a/src/hash.c b/src/hash.c index bd205af..92067ed 100644 --- a/src/hash.c +++ b/src/hash.c @@ -465,6 +465,9 @@ AddChannelUser(struct userNode *user, struct chanNode* channel) modeList_append(&channel->members, mNode); modeList_append(&user->channels, mNode); + if (channel->members.used == 1) + mNode->modes |= MODE_CHANOP; + for (n=0; n