]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Assorted tweaks.
authorsplidge <redacted>
Mon, 10 Mar 2008 20:29:45 +0000 (20:29 +0000)
committersplidge <redacted>
Mon, 10 Mar 2008 20:29:45 +0000 (20:29 +0000)
Changed L import so you can't be imported with +agov.
Changed some help text
Changed UNBANME so it just aborts if it bumps into a registered ban it can't remove.

chanserv/chancmds/autolimit.c
chanserv/chancmds/ban.c
chanserv/chancmds/commandlist.c
chanserv/chancmds/permban.c
chanserv/chancmds/recover.c
chanserv/chancmds/tempban.c
chanserv/chancmds/unbanmask.c
chanserv/chancmds/unbanme.c
chanserv/chanserv.h
chanserv/chanservuser.c
chanserv/utils/conv4.pl

index f7e1860a8df188ec11b68b752e8b849cab9b379b..e7f6d12f4386b59c44504970626d82cea48bccad 100644 (file)
@@ -8,8 +8,13 @@
  * CMDFUNC: csc_doautolimit
  * CMDPROTO: int csc_doautolimit(void *source, int cargc, char **cargv);
  * CMDHELP: Usage: AUTOLIMIT <channel> [<threshold>]
- * CMDHELP: This command shows or changes the number of free slots to keep on the channel
- * CMDHELP: when autolimit (see CHANFLAGS) is enabled.  Where:
+ * CMDHELP: The autolimit feature maintains a user limit (+l) on the channel which is
+ * CMDHELP: regularly updated to keep a fixed number of spaces free on the channel for
+ * CMDHELP: people to join.  This is useful since it prevents a large number of \"clones\"
+ * CMDHELP: joining at the same time.  However, if the number of free spaces is too small
+ * CMDHELP: it's possible that legitimate users won't be able to join.  This command allows
+ * CMDHELP: you to adjust the number of free spaces to maintain when autolimit is enabled.  
+ * CMDHELP: To actually turn the autolimit feature on or off, see CHANFLAGS.  Where:
  * CMDHELP: channel   - the channel to use.
  * CMDHELP: threshold - specifies the new threshold.  If not specified, the current threshold 
  * CMDHELP:             is displayed.
index fc91f8f41c9b4120e2bdb8b7b6d83490fdd4fe2e..a42835bcd676561b09ca1c2ef6157442f2d259c7 100644 (file)
@@ -11,7 +11,7 @@
  * CMDHELP: Permanently bans the provided hostmask on the channel.  If the ban is
  * CMDHELP: removed from the channel e.g. by a channel op or the BANTIMER feature, the
  * CMDHELP: ban will be reapplied if a matching user joins the channel.  Bans
- * CMDHELP: set with the PERMBAN command can be removed via BANCLEAR or BANDEL.  Any users
+ * CMDHELP: set with the PERMBAN command can be removed with BANCLEAR or BANDEL.  Any users
  * CMDHELP: matching the hostmask will be kicked from the channel.
  * CMDHELP: Where:
  * CMDHELP: channel  - channel to set a ban on
index c98dffbfc235b828e53cc92a18264881767f09d6..1db43b55262912e115f1737b7b2042a0469ed86f 100644 (file)
@@ -48,8 +48,8 @@ int csc_dowelcome(void *source, int cargc, char **cargv);
 void _init() {
   chanservaddcommand("addchan", QCMD_OPER, 4, csc_doaddchan, "Adds a new channel to the bot.", "Usage: addchan <channel> [<owner> [<flags> [<type>]]]\nAdds the given channel to the bot, where:\nowner - can be either nickname on the network or #authname.  If not supplied,\n        the channel will belong to the user issuing the ADDCHAN command.\nflags - can be any valid chanflags (see CHANFLAGS).  If not specified this \n        defaults to +j.\ntype  - is a channel type as per old Q and is now obsolete.\n");
   chanservaddcommand("adduser", QCMD_AUTHED, 20, csc_doadduser, "Adds one or more users to a channel as +aot.", "Usage: ADDUSER <channel> [<flags>] <user1> [<user2> [<user3> [...]]]\nAdds the named user(s) to the channel, where:\nchannel - the channel to use\nflags   - the list of flags to add for each user, introduced by + (for example\n          +gv).  See CHANLEV for valid flags.  If no flags are specified, \n          +aot is used.  This command cannot be used to add masters (+m) or\n          owners (+n).\nuser<n> - either a user's current nickname on the network or #accountname. Up to\n          18 users can be specified.\nADDUSER requires master (+m) access on the named channel.\n");
-  chanservaddcommand("autolimit", QCMD_AUTHED, 2, csc_doautolimit, "Shows or changes the autolimit threshold on a channel.", "Usage: AUTOLIMIT <channel> [<threshold>]\nThis command shows or changes the number of free slots to keep on the channel\nwhen autolimit (see CHANFLAGS) is enabled.  Where:\nchannel   - the channel to use.\nthreshold - specifies the new threshold.  If not specified, the current threshold \n            is displayed.\nViewing the current threshold requires operator (+o) access on the named channel.\nUpdating the threshold requires master (+m) access on the named channel.\n");
-  chanservaddcommand("ban", QCMD_AUTHED | QCMD_ALIAS, 3, csc_dopermban, "Permanently bans a hostmask on a channel.", "Usage: BAN <channel> <hostmask> [<reason>]\nPermanently bans the provided hostmask on the channel.  If the ban is\nremoved from the channel e.g. by a channel op or the BANTIMER feature, the\nban will be reapplied if a matching user joins the channel.  Bans\nset with the PERMBAN command can be removed via BANCLEAR or BANDEL.  Any users\nmatching the hostmask will be kicked from the channel.\nWhere:\nchannel  - channel to set a ban on\nhostmask - hostmask (nick!user@host) to ban.\nreason   - reason for the ban.  This will be used in kick messages when kicking\n           users matching the ban.  If this is not provided the generic message\n           \"Banned.\" will be used.\nBAN requires master (+m) access on the named channel.\nBAN is an alias for PERMBAN.\n");
+  chanservaddcommand("autolimit", QCMD_AUTHED, 2, csc_doautolimit, "Shows or changes the autolimit threshold on a channel.", "Usage: AUTOLIMIT <channel> [<threshold>]\nThe autolimit feature maintains a user limit (+l) on the channel which is\nregularly updated to keep a fixed number of spaces free on the channel for\npeople to join.  This is useful since it prevents a large number of \"clones\"\njoining at the same time.  However, if the number of free spaces is too small\nit's possible that legitimate users won't be able to join.  This command allows\nyou to adjust the number of free spaces to maintain when autolimit is enabled.  \nTo actually turn the autolimit feature on or off, see CHANFLAGS.  Where:\nchannel   - the channel to use.\nthreshold - specifies the new threshold.  If not specified, the current threshold \n            is displayed.\nViewing the current threshold requires operator (+o) access on the named channel.\nUpdating the threshold requires master (+m) access on the named channel.\n");
+  chanservaddcommand("ban", QCMD_AUTHED | QCMD_ALIAS, 3, csc_dopermban, "Permanently bans a hostmask on a channel.", "Usage: BAN <channel> <hostmask> [<reason>]\nPermanently bans the provided hostmask on the channel.  If the ban is\nremoved from the channel e.g. by a channel op or the BANTIMER feature, the\nban will be reapplied if a matching user joins the channel.  Bans\nset with the PERMBAN command can be removed with BANCLEAR or BANDEL.  Any users\nmatching the hostmask will be kicked from the channel.\nWhere:\nchannel  - channel to set a ban on\nhostmask - hostmask (nick!user@host) to ban.\nreason   - reason for the ban.  This will be used in kick messages when kicking\n           users matching the ban.  If this is not provided the generic message\n           \"Banned.\" will be used.\nBAN requires master (+m) access on the named channel.\nBAN is an alias for PERMBAN.\n");
   chanservaddcommand("banclear", QCMD_AUTHED, 1, csc_dobanclear, "Removes all bans from a channel including persistent bans.", "Usage: BANCLEAR <channel>\nRemoves all temporary and persistent bans from a channel, where:\nchannel - the channel to use\nBANCLEAR requires master (+m) access on the named channel.\n");
   chanservaddcommand("bandel", QCMD_AUTHED, 2, csc_dobandel, "Removes a single ban from a channel.", "Usage: BANDEL <channel> <ban>\nRemoves the specified persistent or channel ban, where:\nchannel - the channel to use\nban     - either a ban mask (nick!user@host), or #number (see BANLIST)\nRemoving channel bans requires operator (+o) access on the named channel.\nRemoving persistent bans requires master (+m) access on the named channel.\n");
   chanservaddcommand("banlist", QCMD_AUTHED, 1, csc_dobanlist, "Displays all persistent bans on a channel.", "Usage: BANLIST <channel>\nDisplays a list of persistent and channel bans on the named channel.  Each ban\nis identified by a number which can be passed to a subsequent BANDEL command.\nNote that the numbers can change if bans are added to or removed from the \nchennel. Where:\nchannel - the channel to use\nBANLIST requires operator (+o) access on the named channel.\n");
@@ -69,7 +69,7 @@ void _init() {
   chanservaddcommand("giveowner", QCMD_AUTHED, 3, csc_dogiveowner, "Gives total control over a channel to another user.", "Usage: GIVEOWNER <channel> <user> [<code>]\nGives complete control (+n flag) to the named user on the channel.  The new owner\nwill have full control over the channel, including the ability to remove the\nexisting owner(s).  As a precaution the named user must already have master (+m) \naccess on the channel.  Use this command with extreme caution.  Where:\nchannel - channel to use\nuser    - user to give owner to, either a nickname on the network or #accountname.\ncode    - a unique code used to authorize the operation.  If the code is not \n          supplied, the appropriate code will be provided together with a \n          warning about the dangers of this command.  If the wrong code is\n          entered owner access will not be granted.\nGIVEOWNER requires owner (+n) access on the named channel.\n");
   chanservaddcommand("invite", QCMD_AUTHED, 1, csc_doinvite, "Invites you to a channel.", "Usage: INVITE <channel>\nInvites you to the named channel, where:\nchannel - channel to be invited to.\nINVITE requires you to be known (+k) on the named channel.\n");
   chanservaddcommand("op", QCMD_AUTHED, 20, csc_doop, "Ops you or other users on channel(s).", "Usage: OP [<channel> [<user1> [<user2> [...]]]\nOps you on one or more channels, or ops other named users on a given channel.\nThis command cannot be used to op users who are otherwise prevented from getting\nops, e.g. via the +d chanlev flag (see CHANLEV) or bitch mode (see CHANFLAGS).\nWhere:\nchannel - channel to use.  If no channel is specified, you will be given ops on\n          every channel where you have appropriate access and are not already\n          opped.\nuser<n> - user(s) to op instead of yourself.  Each user must be specified as the\n          current nickname of a user on the named channel.\nOP requires operator access (+o) on the named channel.  If this command is used\nto op other users, a notice will be sent to other channel operators on the \nchannel identifying you, unless you have master (+m) access.\n");
-  chanservaddcommand("permban", QCMD_AUTHED, 3, csc_dopermban, "Permanently bans a hostmask on a channel.", "Usage: PERMBAN <channel> <hostmask> [<reason>]\nPermanently bans the provided hostmask on the channel.  If the ban is\nremoved from the channel e.g. by a channel op or the BANTIMER feature, the\nban will be reapplied if a matching user joins the channel.  Bans\nset with the PERMBAN command can be removed via BANCLEAR or BANDEL.  Any users\nmatching the hostmask will be kicked from the channel.\nWhere:\nchannel  - channel to set a ban on\nhostmask - hostmask (nick!user@host) to ban.\nreason   - reason for the ban.  This will be used in kick messages when kicking\n           users matching the ban.  If this is not provided the generic message\n           \"Banned.\" will be used.\nPERMBAN requires master (+m) access on the named channel.\n");
+  chanservaddcommand("permban", QCMD_AUTHED, 3, csc_dopermban, "Permanently bans a hostmask on a channel.", "Usage: PERMBAN <channel> <hostmask> [<reason>]\nPermanently bans the provided hostmask on the channel.  If the ban is\nremoved from the channel e.g. by a channel op or the BANTIMER feature, the\nban will be reapplied if a matching user joins the channel.  Bans\nset with the PERMBAN command can be removed with BANCLEAR or BANDEL.  Any users\nmatching the hostmask will be kicked from the channel.\nWhere:\nchannel  - channel to set a ban on\nhostmask - hostmask (nick!user@host) to ban.\nreason   - reason for the ban.  This will be used in kick messages when kicking\n           users matching the ban.  If this is not provided the generic message\n           \"Banned.\" will be used.\nPERMBAN requires master (+m) access on the named channel.\n");
   chanservaddcommand("recover", QCMD_AUTHED, 1, csc_dorecover, "Recovers a channel (same as deopall, unbanall, clearchan).", "Usage: RECOVER <channel>\nThis command resets the named channel if undesired modes, bans or ops have been\nset.  This has the same effect as DEOPALL followed by UNBANALL followed by\nCLEARCHAN on the channel, where:\nchannel - channel to recover\nRECOVER requires master (+m) access on the named channel.\n");
   chanservaddcommand("rejoin", QCMD_OPER, 1, csc_dorejoin, "Makes the bot rejoin a channel.", "");
   chanservaddcommand("removeuser", QCMD_AUTHED, 20, csc_doremoveuser, "Removes one or more users from a channel.", "Usage: REMOVEUSER <channel> <user1> [<user2> [<user3> [...]]]\nRemoves any flags the named user(s) have on the channel.  This command\ncannot be used to remove owners (+n) from the channel, and cannot be used\nto remove masters (+m) unless the user issuing the command is an owner.\nWhere:\nchannel - channel to use\nuser<n> - a user to remove.  Can either be a nickname on the network\n          or #authname.  Up to 18 users can be specified.\nREMOVEUSER requires master (+m) access on the named channel.\n");
@@ -79,7 +79,7 @@ void _init() {
   chanservaddcommand("settopic", QCMD_AUTHED, 2, csc_dosettopic, "Changes the topic on a channel.", "Usage: SETTOPIC <channel> [<topic>]\nChanges the topic on the channel, where:\nchannel - channel to use\ntopic   - new topic.  If no topic is set, the stored topic will be reset (this\n          feature is useful if some users can no longer see the topic due to a \n          netsplit).\nSETTOPIC requires topic (+t) or master (+m) access on the named channel.\n");
   chanservaddcommand("suspendchan", QCMD_OPER, 2, csc_dosuspendchan, "Suspends a channel from the bot.", "");
   chanservaddcommand("suspendchanlist", QCMD_HELPER, 1, csc_dosuspendchanlist, "Lists suspended channels.", "");
-  chanservaddcommand("tempban", QCMD_AUTHED, 4, csc_dotempban, "Bans a hostmask on a channel for a specified time period.", "Usage: TEMPBAN <channel> <hostmask> <duration> [<reason>]\nTemporarily bans the provided hostmask on the channel.  If the ban is\nremoved from the channel e.g. by a channel op or the BANTIMER feature, the\nban will be reapplied if a matching user joins the channel.  When the time \nexpires the ban will be removed automatically.  Bans set with the TEMPBAN \ncommand can be removed via BANCLEAR or BANDEL.  Any users matching the hostmask \nwill be kicked from the channel.\nWhere:\nchannel  - channel to set a ban on\nhostmask - hostmask (nick!user@host) to ban.\nduration - length of time to apply the ban for.  Suffixes m (minutes), h (hours),\n           d (days), w (weeks), M (months) and y (years) can be used to specify \n           the duration, for example 3d, 5h, 1h30m, 1M.\nreason   - reason for the ban.  This will be used in kick messages when kicking\n           users matching the ban.  If this is not provided the generic message\n           \"Banned.\" will be used.\nTEMPBAN requires master (+m) access on the named channel.\n");
+  chanservaddcommand("tempban", QCMD_AUTHED, 4, csc_dotempban, "Bans a hostmask on a channel for a specified time period.", "Usage: TEMPBAN <channel> <hostmask> <duration> [<reason>]\nTemporarily bans the provided hostmask on the channel.  If the ban is\nremoved from the channel e.g. by a channel op or the BANTIMER feature, the\nban will be reapplied if a matching user joins the channel.  When the time \nexpires the ban will be removed automatically.  Bans set with the TEMPBAN \ncommand can be removed before they expire with BANCLEAR or BANDEL.  Any users \nmatching the hostmask will be kicked from the channel.\nWhere:\nchannel  - channel to set a ban on\nhostmask - hostmask (nick!user@host) to ban.\nduration - length of time to apply the ban for.  Suffixes m (minutes), h (hours),\n           d (days), w (weeks), M (months) and y (years) can be used to specify \n           the duration, for example 3d, 5h, 1h30m, 1M.\nreason   - reason for the ban.  This will be used in kick messages when kicking\n           users matching the ban.  If this is not provided the generic message\n           \"Banned.\" will be used.\nTEMPBAN requires master (+m) access on the named channel.\n");
   chanservaddcommand("unban", QCMD_AUTHED | QCMD_ALIAS, 2, csc_dobandel, "Removes a single ban from a channel.", "Usage: UNBAN <channel> <ban>\nRemoves the specified persistent or channel ban, where:\nchannel - the channel to use\nban     - either a ban mask (nick!user@host), or #number (see BANLIST)\nRemoving channel bans requires operator (+o) access on the named channel.\nRemoving persistent bans requires master (+m) access on the named channel.\nUNBAN is an alias for BANDEL.\n");
   chanservaddcommand("unbanall", QCMD_AUTHED, 1, csc_dounbanall, "Removes all bans from a channel.", "Usage: UNBANALL <channel>\nRemoves all the channel bans set on the named channel.  This does not affect\npersistent bans set via the TEMPBAN and PERMBAN commands, see BANCLEAR or\nBANDEL for more information on removing those bans.  Where:\nchannel - channel to use\nUNBANALL requires master (+m) access on the named channel.\n");
   chanservaddcommand("unbanmask", QCMD_AUTHED, 2, csc_dounbanmask, "Removes bans matching a particular mask from a channel.", "Usage: UNBANMASK <channel> <mask>\nRemoves any bans on the channel which are overlapped by the named mask.  Can\nremove both channel bans and registered bans.  Where:\nchannel - channel to use\nmask    - mask to remove.  Any ban subsumed by this mask will be removed.  For\n          example, UNBANMASK *!*@*.isp.net would remove *!*@host1.isp.net and \n          *!*@host2.isp.net and *!user@*.isp.net.\nUNBANMASK requires operator (+o) access on the named channel.\nRemoving registered bans requires master (+m) access on the named channel.\n");
index c64c5fd4253236ad3a22fab9d74dd3a4b48b7b0b..37de6c47fe1a13ae899e131c007d9716d5cf6e74 100644 (file)
@@ -11,7 +11,7 @@
  * CMDHELP: Permanently bans the provided hostmask on the channel.  If the ban is
  * CMDHELP: removed from the channel e.g. by a channel op or the BANTIMER feature, the
  * CMDHELP: ban will be reapplied if a matching user joins the channel.  Bans
- * CMDHELP: set with the PERMBAN command can be removed via BANCLEAR or BANDEL.  Any users
+ * CMDHELP: set with the PERMBAN command can be removed with BANCLEAR or BANDEL.  Any users
  * CMDHELP: matching the hostmask will be kicked from the channel.
  * CMDHELP: Where:
  * CMDHELP: channel  - channel to set a ban on
index 05ed9b1793b80d03fc9cbb23722a021dff9e938c..e7dd75f0fba4c7738dd153c12b872af627a9d1af 100644 (file)
@@ -60,7 +60,7 @@ int csc_dorecover(void *source, int cargc, char **cargv) {
     }
 
     /* remove the registered bans that match on me */
-    cs_unbanfn(sender, cip, (UnbanFN)nickmatchban, sender, 1);
+    cs_unbanfn(sender, cip, (UnbanFN)nickmatchban, sender, 1, 0);
 
     /* deopall */
     for (i=0,lp=cip->channel->users->content;
index 774d1f3e272e4192c011885cb9410a884ff87f2e..4019948d0fc3ad31b4fc56408fedebd7777ca09e 100644 (file)
@@ -12,8 +12,8 @@
  * CMDHELP: removed from the channel e.g. by a channel op or the BANTIMER feature, the
  * CMDHELP: ban will be reapplied if a matching user joins the channel.  When the time 
  * CMDHELP: expires the ban will be removed automatically.  Bans set with the TEMPBAN 
- * CMDHELP: command can be removed via BANCLEAR or BANDEL.  Any users matching the hostmask 
- * CMDHELP: will be kicked from the channel.
+ * CMDHELP: command can be removed before they expire with BANCLEAR or BANDEL.  Any users 
+ * CMDHELP: matching the hostmask will be kicked from the channel.
  * CMDHELP: Where:
  * CMDHELP: channel  - channel to set a ban on
  * CMDHELP: hostmask - hostmask (nick!user@host) to ban.
index 56dc5ce10f9073ee822332409c0a71cc1a223935..3534cd9348257847aba55f3f259b6c23dbd12526 100644 (file)
@@ -44,7 +44,7 @@ int csc_dounbanmask(void *source, int cargc, char **cargv) {
 
   theban=makeban(cargv[1]);
   /* nice cast here */
-  cs_unbanfn(sender, cip, (UnbanFN)banoverlap, theban, 1);
+  cs_unbanfn(sender, cip, (UnbanFN)banoverlap, theban, 1, 0);
   cs_log(sender,"UNBANMASK %s",bantostring(theban));
 
   chanservstdmessage(sender, QM_DONE);
index d8b6d5cb5f275562db09730a6774085807ea1e03..b0fcefb80dbfb869f7c1298e3e711335d2a48ae0 100644 (file)
@@ -37,9 +37,11 @@ int csc_dounbanme(void *source, int cargc, char **cargv) {
   if (!(cip=cs_checkaccess(sender, cargv[0], CA_OPPRIV, NULL, "unbanme", 0, 0)))
     return CMD_ERROR;
 
-  cs_unbanfn(sender, cip, (UnbanFN)nickmatchban, sender, 1);
+  /* Try to unban, if it fails we'll let the failure message speak for itself */
+  if (!cs_unbanfn(sender, cip, (UnbanFN)nickmatchban, sender, 1, 1)) {
+    chanservstdmessage(sender, QM_DONE);
+  }  
 
   cs_log(sender,"UNBANME %s",cip->name->content);
-  chanservstdmessage(sender, QM_DONE);
   return CMD_OK;
 }     
index d970950df8f645caacc0390f11668b9bef48b25c..388143dccdf85f667f90248580764283338abfc5 100644 (file)
@@ -959,7 +959,7 @@ int checkresponse(reguser *rup, const unsigned char *entropy, const char *respon
 int checkhashpass(reguser *rup, const char *junk, const char *hash);
 flag_t cs_sanitisechanlev(flag_t flags);
 typedef int (*UnbanFN)(void *arg, struct chanban *ban);
-void cs_unbanfn(nick *sender, chanindex *cip, UnbanFN fn, void *arg, int removepermbans);
+int cs_unbanfn(nick *sender, chanindex *cip, UnbanFN fn, void *arg, int removepermbans, int abortonfailure);
 void cs_logchanop(regchan *rcp, char *nick, reguser *rup);
 
 /* chanservstdcmds.c */
index adff71ef15fa6114f2414804e172e25035ae6ddb..1be373d9d6cd84f58fd88064f61397f32fae26eb 100644 (file)
@@ -247,8 +247,8 @@ void chanservjoinchan(channel *cp) {
   if (!(rcp=cp->index->exts[chanservext]))
     return;
     
-  /* Check for a new timestamp */
-  if ((!rcp->ltimestamp) || (cp->timestamp < rcp->ltimestamp)) {
+  /* Check for a new timestamp.  But don't do anything stupid if the incoming timestamp is 0 */
+  if (cp->timestamp && ((!rcp->ltimestamp) || (cp->timestamp < rcp->ltimestamp))) {
     rcp->ltimestamp=cp->timestamp;
     csdb_updatechanneltimestamp(rcp);
   }
@@ -1250,8 +1250,10 @@ reguser *findreguser(nick *sender, const char *str) {
 
 /*
  * Unbans a mask from a channel, including permbans if user has correct privs.
+ *
+ * Return 0 if it works, 1 if it don't.
  */
-void cs_unbanfn(nick *sender, chanindex *cip, UnbanFN fn, void *arg, int removepermbans) {
+int cs_unbanfn(nick *sender, chanindex *cip, UnbanFN fn, void *arg, int removepermbans, int abortonfailure) {
   regban **rbh, *rbp;
   chanban **cbh, *cbp;
   regchan *rcp;
@@ -1273,6 +1275,7 @@ void cs_unbanfn(nick *sender, chanindex *cip, UnbanFN fn, void *arg, int removep
         rbh=&(rbp->next);
       } else if (!cs_checkaccess(sender, NULL, CA_MASTERPRIV, cip, NULL, 0, 1)) {
         chanservstdmessage(sender, QM_NOTREMOVEDPERMBAN, banstr, cip->name->content);
+        if (abortonfailure) return 1; /* Just give up... */
         rbh=&(rbp->next);
       } else {
         chanservstdmessage(sender, QM_REMOVEDPERMBAN, banstr, cip->name->content);
@@ -1306,6 +1309,8 @@ void cs_unbanfn(nick *sender, chanindex *cip, UnbanFN fn, void *arg, int removep
     }
     localsetmodeflush(&changes,1);
   }
+  
+  return 0;
 }
 
 /* Add entry to channel op history when someone gets ops. */
index dae9783422e9b098ddd869e3fb24885c035a485c..10f6c4cf7ac0656fe3aede6d35837fe6b57a2bcc 100644 (file)
@@ -551,12 +551,13 @@ sub loadldb {
        my $ocuflags=$2;
        $userid=getuserid($1);
        if ($userid != 0) {
-         if ($ocuflags =~ /a/) {
-           $cuflags |= 0x1;
-         }
-         if ($ocuflags =~ /g/) {
+         if (($ocuflags =~ /g/) && ($ocuflags =~ /v/)) {
            $cuflags |= 0x8;
          }
+         if (($ocuflags =~ /a/) && ($ocuflags =~ /o/)) {
+           $cuflags |= 0x1;
+           $cuflags &= (~0x8);
+         }
          if ($ocuflags =~ /m/) {
            $cuflags |= 0x4000;
          }