Author: David M <captj@superlink.net>
authorBleep <twhelvey1@home.com>
Thu, 20 Jan 2000 04:51:31 +0000 (04:51 +0000)
committerBleep <twhelvey1@home.com>
Thu, 20 Jan 2000 04:51:31 +0000 (04:51 +0000)
            Run     <carlo@alinoe.com>
Log message:
- Fixes a bug making all of the patch's functionality restricted to global
opers, whereas it was intended to be for both local and global opers, since
it only affects the local server.

- Now requires opers who want to join a local channel where they normally
couldnt to use a /join &channel OVERRIDE to force the join. This generates
a HACK(4) server notice. Previous patch was silent on forced joins.

Update URL in readme.www

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@16 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
doc/readme.www
include/channel.h
ircd/channel.c
ircd/numnicks.c

index 469ce0f20d885c049ef6eee36f00b9c2f1bd5db4..7f3ca5d0659d2ca11361fe70828b46fb57253408 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,15 @@
 #
 # ChangeLog for Undernet ircu Servers
 #
-# $Id: ChangeLog,v 1.6 2000-01-01 00:00:32 bleep Exp $
+# $Id: ChangeLog,v 1.7 2000-01-20 04:51:29 bleep Exp $
 #
 # Please insert new entries on the top of the list, a one or two line comment
 # is sufficient. Please include your name on the entries we know who to blame.
 # Please keep lines < 80 chars.
 #-------------------------------------------------------------------------------
+* doc/readme.www: add Runs link update patch for linux info. --Bleep
+* channel.c, channel.h: add David M's fixup for local channel oper overrides.
+  --Bleep
 * s_misc.c (date): add Runs Y2K patch --Bleep
 * hash.c (hChangeClient): bug fix. If the client pointer matched the first
   pointer in the bucket, the change was ignored (returned 0), leaving stale
index f3c25e7e9d504198e50a988fc40c6706c83066f8..b6508a0c72899dd6b77fe7851c20d7a15e3de7a7 100644 (file)
@@ -20,4 +20,4 @@ world wide web pages:
                http://routing-com.undernet.org/
 
 * Information about large number of file descriptors per process:
-  linux:       ftp://ftp.linux.org.za/linux/local/kernel/
+  linux:       http://www.linux.org.za/oskar/patches/kernel/filehandle/
index 167e9cf2346c00b2fc360b536dea22e7d0a8b396..abe7e1eb18cb0493abf64e294c112cdb8e55c00b 100644 (file)
 
 /* Check if a sptr is an oper, and chptr is a local channel. */
 
-#define IsOperOnLocalChannel(sptr,chname) ((IsOper(sptr)) && (IsLocalChannel(chname)))
+#define IsOperOnLocalChannel(sptr,chname) ((IsAnOper(sptr)) \
+                                          && (IsLocalChannel(chname)))
+
+#ifdef OPER_WALK_THROUGH_LMODES
+  /* used in can_join to determine if an oper forced a join on a channel */
+  #define MAGIC_OPER_OVERRIDE 1000
+#endif
+
+
 
 /* used in SetMode() in channel.c and m_umode() in s_msg.c */
 
index 27b6e95f555371020c4da447e80d32bf302ccfb7..651cdd61053ba148b11f7ecbb62420c3d5b6d5fc 100644 (file)
@@ -850,7 +850,7 @@ int m_mode(aClient *cptr, aClient *sptr, int parc, char *parv[])
                                 me.name, chptr->chname, modebuf, parabuf);
          sendto_op_mask(SNO_HACK4, 
                         "OPER MODE: %s MODE %s %s %s",
-                        me.name,chptr->chname,modebuf,parabuf);
+                        sptr->name,chptr->chname,modebuf,parabuf);
        }
        else
 #endif
@@ -1987,10 +1987,15 @@ top:
 static int can_join(aClient *sptr, aChannel *chptr, char *key)
 {
   Reg1 Link *lp;
-
+  int overrideJoin = 0;  
+  
 #ifdef OPER_WALK_THROUGH_LMODES
-  if (IsOperOnLocalChannel(sptr, chptr->chname))
-    return 0;
+  /* An oper can force a join on a local channel using "OVERRIDE" as the key. 
+     a HACK(4) notice will be sent if he would not have been supposed
+     to join normally. */ 
+  if (IsOperOnLocalChannel(sptr,chptr->chname) && !BadPtr(key) && 
+       compall("OVERRIDE",key) == 0)
+    overrideJoin = MAGIC_OPER_OVERRIDE;
 #endif
   /*
    * Now a banned user CAN join if invited -- Nemesi
@@ -2005,20 +2010,20 @@ static int can_join(aClient *sptr, aChannel *chptr, char *key)
     if (!lp)
     {
       if (chptr->mode.limit && chptr->users >= chptr->mode.limit)
-       return (ERR_CHANNELISFULL);
+       return (overrideJoin + ERR_CHANNELISFULL);
       /*
        * This can return an "Invite only" msg instead of the "You are banned"
        * if _both_ conditions are true, but who can say what is more
        * appropriate ? checking again IsBanned would be _SO_ cpu-xpensive !
        */
-      return ((chptr->mode.mode & MODE_INVITEONLY) ?
+      return overrideJoin + ((chptr->mode.mode & MODE_INVITEONLY) ?
          ERR_INVITEONLYCHAN : ERR_BANNEDFROMCHAN);
     }
   }
 
   /* now using compall (above) to test against a whole key ring -Kev */
   if (*chptr->mode.key && (BadPtr(key) || compall(chptr->mode.key, key)))
-    return (ERR_BADCHANNELKEY);
+    return overrideJoin + (ERR_BADCHANNELKEY);
 
   return 0;
 }
@@ -2367,7 +2372,7 @@ int m_join(aClient *cptr, aClient *sptr, int parc, char *parv[])
         /*
          * Opers are allowed to join any number of channels
          */
-        if (sptr->user->joined >= MAXCHANNELSPERUSER && !IsOper(sptr))
+        if (sptr->user->joined >= MAXCHANNELSPERUSER && !IsAnOper(sptr))
 #else
         if (sptr->user->joined >= MAXCHANNELSPERUSER)
 #endif
@@ -2421,8 +2426,27 @@ int m_join(aClient *cptr, aClient *sptr, int parc, char *parv[])
        }
        if ((i = can_join(sptr, chptr, keysOrTS)))
        {
-         sendto_one(sptr, err_str(i), me.name, parv[0], chptr->chname);
-         continue;
+#ifdef OPER_WALK_THROUGH_LMODES
+          if (i > MAGIC_OPER_OVERRIDE)
+          {
+            switch(i - MAGIC_OPER_OVERRIDE)
+            {
+              case ERR_CHANNELISFULL: i = 'l'; break;
+              case ERR_INVITEONLYCHAN: i = 'i'; break;
+              case ERR_BANNEDFROMCHAN: i = 'b'; break;
+              case ERR_BADCHANNELKEY: i = 'k'; break;
+            }
+            sendto_op_mask(SNO_HACK4,"OPER JOIN: %s JOIN %s (overriding +%c)",sptr->name,chptr->chname,i);
+          }
+          else
+          {
+            sendto_one(sptr, err_str(i), me.name, parv[0], chptr->chname);
+            continue; 
+          }
+#else    
+          sendto_one(sptr, err_str(i), me.name, parv[0], chptr->chname);
+          continue;
+#endif
        }
       }
       /*
index 09b904cebc287f85f2b23e83559886d9a478a4c1..f5d3e7632ce59247328c7d4857da1cb0073b4833 100644 (file)
@@ -217,14 +217,10 @@ void SetServerYXX(struct Client *cptr, struct Client *server, const char *yxx)
       const char *name;
       unsigned int numeric;
     } server_table[] = {
-      {
-      "Uworld.undernet.org", 22},
-      {
-      "Uworld2.undernet.org", 23},
-      {
-      "channels.undernet.org", 30},
-      {
-      "channels2.undernet.org", 31},
+      { "Uworld.undernet.org",    22},
+      { "Uworld2.undernet.org",   23},
+      { "channels.undernet.org",  30},
+      { "channels2.undernet.org", 31},
       {
       0, 0}
     };