CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2003-08-12 09:41:27 UTC

Modified files:
     ChangeLog include/channel.h include/client.h ircd/channel.c
     ircd/m_burst.c ircd/m_names.c ircd/m_userhost.c ircd/m_userip.c
     ircd/m_who.c ircd/m_whois.c ircd/s_err.c ircd/s_user.c
     ircd/whocmds.c

Log message:

Author: beware (by Spike)
Log message: A bunch of patches done by beware, check ChangeLog for more info.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.385 ircu2.10/ChangeLog:1.386
--- ircu2.10/ChangeLog:1.385    Mon Aug  4 18:30:23 2003
+++ ircu2.10/ChangeLog  Tue Aug 12 02:41:16 2003
@@ -1,3 +1,40 @@
+2003-07-07  Bas Steendijk <[EMAIL PROTECTED]>
+
+        * ircd/s_user.c: invalidate ban cache for user on host hiding/account
+
+2003-07-04  Bas Steendijk <[EMAIL PROTECTED]>
+
+        * include/client.h, ircd/m_userhost.c, ircd/m_userip.c, ircd/m_who.c,
+        ircd/m_whois.c, ircd/whocmds.c: the same code, for "can user A see user
+        B is an oper", appeared in a lot of places. made it a define SeeOper.
+
+2003-07-04  Bas Steendijk  <[EMAIL PROTECTED]>
+        * ircd/s_user.c: umode_str (user modes in N token) internal flags var
+       was not initialized to the user's flags, returned a string with
+       random modes set.
+
+2003-07-01  Bas Steendijk  <[EMAIL PROTECTED]>
+
+        * ircd/m_names.c: length counter being incremented one too many
+        for each nick, resulting names reply messages are about 50 chars
+        shorter than possible. fixed.
+
+2003-06-29  Bas Steendijk  <[EMAIL PROTECTED]>
+
+        * ircd/channel.c: don't ever send mode changes for local channels to
+       servers.
+
+2003-06-27  Bas Steendijk  <[EMAIL PROTECTED]>
+
+        * include/channel.h, include/client.h, ircd/s_user.c, ircd/s_err.c:
+        moved the supported channel/user mode strings of the 004 reply from
+        s_err.c to the header files where the channels/user modes are
+        defined, and show or hide +Au based on OPLEVELS setting.
+
+2003-06-25  Bas Steendijk  <[EMAIL PROTECTED]>
+
+        * ircd/m_burst.c: Clear topic set by netrider on burst.
+
 2003-08-05 Diane Bruce  <[EMAIL PROTECTED]>
 
         * ircd/parse.c: Fixed the typo the fix of the typo created
Index: ircu2.10/include/channel.h
diff -u ircu2.10/include/channel.h:1.35 ircu2.10/include/channel.h:1.36
--- ircu2.10/include/channel.h:1.35     Sat Jan 11 04:49:24 2003
+++ ircu2.10/include/channel.h  Tue Aug 12 02:41:16 2003
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: channel.h,v 1.35 2003/01/11 12:49:24 bleepster Exp $
+ * $Id: channel.h,v 1.36 2003/08/12 09:41:16 denspike Exp $
  */
 #ifndef INCLUDED_channel_h
 #define INCLUDED_channel_h
@@ -99,6 +99,9 @@
  * mode flags which take another parameter (With PARAmeterS)
  */
 #define MODE_WPARAS     
(MODE_CHANOP|MODE_VOICE|MODE_BAN|MODE_KEY|MODE_LIMIT|MODE_APASS|MODE_UPASS)
+
+#define infochanmodes feature_bool(FEAT_OPLEVELS) ? "Abiklmnopstuvr" : "biklmnopstvr"
+#define infochanmodeswithparams feature_bool(FEAT_OPLEVELS) ? "Abklouv" : "bklov"
 
 #define HoldChannel(x)          (!(x))
 /* name invisible */
Index: ircu2.10/include/client.h
diff -u ircu2.10/include/client.h:1.28 ircu2.10/include/client.h:1.29
--- ircu2.10/include/client.h:1.28      Fri Jan 10 21:46:50 2003
+++ ircu2.10/include/client.h   Tue Aug 12 02:41:16 2003
@@ -18,7 +18,7 @@
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  *
- * $Id: client.h,v 1.28 2003/01/11 05:46:50 bleepster Exp $
+ * $Id: client.h,v 1.29 2003/08/12 09:41:16 denspike Exp $
  */
 #ifndef INCLUDED_client_h
 #define INCLUDED_client_h
@@ -81,6 +81,8 @@
 #define FLAGSET_SET(set, flag) (set).bits[FLAGSET_INDEX(flag)] |= FLAGSET_MASK(flag)
 #define FLAGSET_CLEAR(set, flag) (set).bits[FLAGSET_INDEX(flag)] &= 
~FLAGSET_MASK(flag)
 
+#define infousermodes "dioswkgx"
+
 enum Priv
   {
     PRIV_CHAN_LIMIT, /* no channel limit on oper */
@@ -452,6 +454,9 @@
 #define SetAccount(x)           SetFlag(x, FLAG_ACCOUNT)
 #define SetHiddenHost(x)        SetFlag(x, FLAG_HIDDENHOST)
 #define SetPingSent(x)          SetFlag(x, FLAG_PINGSENT)
+
+#define SeeOper(sptr,acptr) (IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) \
+                            || HasPriv(sptr, PRIV_SEE_OPERS)))
 
 #define ClearAccess(x)          ClrFlag(x, FLAG_CHKACCESS)
 #define ClearBurst(x)           ClrFlag(x, FLAG_BURST)
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.84 ircu2.10/ircd/channel.c:1.85
--- ircu2.10/ircd/channel.c:1.84        Sun Jun 22 06:22:38 2003
+++ ircu2.10/ircd/channel.c     Tue Aug 12 02:41:16 2003
@@ -17,7 +17,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: channel.c,v 1.84 2003/06/22 13:22:38 denspike Exp $
+ * $Id: channel.c,v 1.85 2003/08/12 09:41:16 denspike Exp $
  */
 #include "config.h"
 
@@ -1855,6 +1855,8 @@
   assert(0 != source);
   assert(0 != chan);
   assert(0 != dest);
+
+  if (IsLocalChannel(chan->chname)) dest &= ~MODEBUF_DEST_SERVER;
 
   mbuf->mb_add = 0;
   mbuf->mb_rem = 0;
Index: ircu2.10/ircd/m_burst.c
diff -u ircu2.10/ircd/m_burst.c:1.18 ircu2.10/ircd/m_burst.c:1.19
--- ircu2.10/ircd/m_burst.c:1.18        Tue Jan  7 02:06:41 2003
+++ ircu2.10/ircd/m_burst.c     Tue Aug 12 02:41:16 2003
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_burst.c,v 1.18 2003/01/07 10:06:41 a1kmm Exp $
+ * $Id: m_burst.c,v 1.19 2003/08/12 09:41:16 denspike Exp $
  */
 
 /*
@@ -245,6 +245,15 @@
     /* mark bans for wipeout */
     for (lp = chptr->banlist; lp; lp = lp->next)
       lp->flags |= CHFL_BURST_BAN_WIPEOUT;
+
+    /* clear topic set by netrider (if set) */
+    if (*chptr->topic) {
+      *chptr->topic = '\0';
+      *chptr->topic_nick = '\0';
+      chptr->topic_time = 0;
+      sendcmdto_channel_butserv_butone(&me, CMD_TOPIC, chptr, NULL,
+                                       "%H :%s", chptr, chptr->topic);
+    }
   } else if (chptr->creationtime == timestamp) {
     modebuf_init(mbuf = &modebuf, &me, cptr, chptr,
                 MODEBUF_DEST_CHANNEL | MODEBUF_DEST_NOKEY);
Index: ircu2.10/ircd/m_names.c
diff -u ircu2.10/ircd/m_names.c:1.16 ircu2.10/ircd/m_names.c:1.17
--- ircu2.10/ircd/m_names.c:1.16        Tue Jan  7 02:06:40 2003
+++ ircu2.10/ircd/m_names.c     Tue Aug 12 02:41:16 2003
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_names.c,v 1.16 2003/01/07 10:06:40 a1kmm Exp $
+ * $Id: m_names.c,v 1.17 2003/08/12 09:41:16 denspike Exp $
  */
 
 /*
@@ -176,7 +176,7 @@
       idx++;
     }
     strcat(buf, cli_name(c2ptr));
-    idx += strlen(cli_name(c2ptr)) + 1;
+    idx += strlen(cli_name(c2ptr));
     flag = 1;
     if (mlen + idx + NICKLEN + 5 > BUFSIZE)
       /* space, modifier, nick, \r \n \0 */
Index: ircu2.10/ircd/m_userhost.c
diff -u ircu2.10/ircd/m_userhost.c:1.11 ircu2.10/ircd/m_userhost.c:1.12
--- ircu2.10/ircd/m_userhost.c:1.11     Tue Jan  7 19:17:19 2003
+++ ircu2.10/ircd/m_userhost.c  Tue Aug 12 02:41:17 2003
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_userhost.c,v 1.11 2003/01/08 03:17:19 klmitch Exp $
+ * $Id: m_userhost.c,v 1.12 2003/08/12 09:41:17 denspike Exp $
  */
 
 /*
@@ -95,7 +95,7 @@
 {
   assert(IsUser(cptr));
   msgq_append(0, mb, "[EMAIL PROTECTED]", cli_name(cptr),
-             HasPriv(cptr, PRIV_DISPLAY) ? "*" : "",
+              SeeOper(sptr,cptr) ? "*" : "",
              cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username,
              HasHiddenHost(cptr) && !IsAnOper(sptr) ?
              cli_user(cptr)->host : cli_user(cptr)->realhost);
Index: ircu2.10/ircd/m_userip.c
diff -u ircu2.10/ircd/m_userip.c:1.10 ircu2.10/ircd/m_userip.c:1.11
--- ircu2.10/ircd/m_userip.c:1.10       Wed Apr  3 07:23:48 2002
+++ ircu2.10/ircd/m_userip.c    Tue Aug 12 02:41:17 2003
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_userip.c,v 1.10 2002/04/03 15:23:48 kev Exp $
+ * $Id: m_userip.c,v 1.11 2003/08/12 09:41:17 denspike Exp $
  */
 
 /*
@@ -96,7 +96,7 @@
 {
   assert(IsUser(cptr));
   msgq_append(0, mb, "[EMAIL PROTECTED]", cli_name(cptr),
-             HasPriv(cptr, PRIV_DISPLAY) ? "*" : "",
+             SeeOper(sptr,cptr) ? "*" : "",
              cli_user(cptr)->away ? '-' : '+', cli_user(cptr)->username,
              HasHiddenHost(cptr) && !IsAnOper(sptr) ?
              feature_str(FEAT_HIDDEN_IP) :
Index: ircu2.10/ircd/m_who.c
diff -u ircu2.10/ircd/m_who.c:1.15 ircu2.10/ircd/m_who.c:1.16
--- ircu2.10/ircd/m_who.c:1.15  Tue Jan  7 19:17:19 2003
+++ ircu2.10/ircd/m_who.c       Tue Aug 12 02:41:17 2003
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_who.c,v 1.15 2003/01/08 03:17:19 klmitch Exp $
+ * $Id: m_who.c,v 1.16 2003/08/12 09:41:17 denspike Exp $
  */
 
 /*
@@ -321,9 +321,7 @@
           for (member = chptr->members; member; member = member->next_member)
           {
             acptr = member->user;
-            if ((bitsel & WHOSELECT_OPER) &&
-               !(IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
-                                     HasPriv(sptr, PRIV_SEE_OPERS))))
+            if ((bitsel & WHOSELECT_OPER) && !SeeOper(sptr,acptr))
               continue;
             if ((acptr != sptr) && (member->status & CHFL_ZOMBIE))
               continue;
@@ -340,9 +338,7 @@
       else
       {
         if ((acptr = FindUser(nick)) &&
-            ((!(bitsel & WHOSELECT_OPER)) ||
-            (IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
-                                 HasPriv(sptr, PRIV_SEE_OPERS)))) &&
+            ((!(bitsel & WHOSELECT_OPER)) || SeeOper(sptr,acptr)) &&
             Process(acptr) && SHOW_MORE(sptr, counter))
         {
           do_who(sptr, acptr, 0, fields, qrt);
@@ -386,9 +382,7 @@
           if (!(IsUser(acptr) && Process(acptr)))
             continue;           /* Now Process() is at the beginning, if we fail
                                    we'll never have to show this acptr in this query 
*/
-         if ((bitsel & WHOSELECT_OPER) &&
-             !(IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
-                                   HasPriv(sptr, PRIV_SEE_OPERS))))
+         if ((bitsel & WHOSELECT_OPER) && !SeeOper(sptr,acptr))
            continue;
           if ((mask) &&
               ((!(matchsel & WHO_FIELD_NIC))
@@ -424,9 +418,7 @@
       {
         if (!(IsUser(acptr) && Process(acptr)))
           continue;
-       if ((bitsel & WHOSELECT_OPER) &&
-           !(IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
-                                 HasPriv(sptr, PRIV_SEE_OPERS))))
+       if ((bitsel & WHOSELECT_OPER) && !SeeOper(sptr,acptr))
          continue;
         if (!(SEE_USER(sptr, acptr, bitsel)))
           continue;
Index: ircu2.10/ircd/m_whois.c
diff -u ircu2.10/ircd/m_whois.c:1.27 ircu2.10/ircd/m_whois.c:1.28
--- ircu2.10/ircd/m_whois.c:1.27        Sat Jan 11 04:49:26 2003
+++ ircu2.10/ircd/m_whois.c     Tue Aug 12 02:41:17 2003
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: m_whois.c,v 1.27 2003/01/11 12:49:26 bleepster Exp $
+ * $Id: m_whois.c,v 1.28 2003/08/12 09:41:17 denspike Exp $
  */
 
 /*
@@ -196,8 +196,7 @@
     if (user->away)
        send_reply(sptr, RPL_AWAY, name, user->away);
 
-    if (IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) ||
-                           HasPriv(sptr, PRIV_SEE_OPERS)))
+    if (SeeOper(sptr,acptr))
        send_reply(sptr, RPL_WHOISOPERATOR, name);
 
     if (IsAccount(acptr))
Index: ircu2.10/ircd/s_err.c
diff -u ircu2.10/ircd/s_err.c:1.41 ircu2.10/ircd/s_err.c:1.42
--- ircu2.10/ircd/s_err.c:1.41  Thu Jan  9 14:08:46 2003
+++ ircu2.10/ircd/s_err.c       Tue Aug 12 02:41:17 2003
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: s_err.c,v 1.41 2003/01/09 22:08:46 shad0w Exp $
+ * $Id: s_err.c,v 1.42 2003/08/12 09:41:17 denspike Exp $
  */
 #include "config.h"
 
@@ -36,7 +36,7 @@
 /* 003 */
   { RPL_CREATED, ":This server was created %s", "003" },
 /* 004 */
-  { RPL_MYINFO, "%s %s dioswkgx Abiklmnopstuvr Abklouv", "004" },
+  { RPL_MYINFO, "%s %s %s %s %s", "004" },
 /* 005 */
   { RPL_ISUPPORT, "%s :are supported by this server", "005" },
 /* 006 */
Index: ircu2.10/ircd/s_user.c
diff -u ircu2.10/ircd/s_user.c:1.63 ircu2.10/ircd/s_user.c:1.64
--- ircu2.10/ircd/s_user.c:1.63 Sun Jan 12 16:20:06 2003
+++ ircu2.10/ircd/s_user.c      Tue Aug 12 02:41:17 2003
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: s_user.c,v 1.63 2003/01/13 00:20:06 bleepster Exp $
+ * $Id: s_user.c,v 1.64 2003/08/12 09:41:17 denspike Exp $
  */
 #include "config.h"
 
@@ -551,7 +551,8 @@
      */
     send_reply(sptr, RPL_YOURHOST, cli_name(&me), version);
     send_reply(sptr, RPL_CREATED, creation);
-    send_reply(sptr, RPL_MYINFO, cli_name(&me), version);
+    send_reply(sptr, RPL_MYINFO, cli_name(&me), infousermodes, infochanmodes,
+               infochanmodeswithparams, version);
     send_supported(sptr);
     m_lusers(sptr, sptr, 1, parv);
     update_load();
@@ -1057,6 +1058,11 @@
       flag == FLAG_HIDDENHOST)
     return 0;
 
+/* Invalidate all bans against the user so we check them again */
+      for (chan = (cli_user(cptr))->channel; chan;
+           chan = chan->next_channel)
+        ClearBanValid(chan);
+
   SetFlag(cptr, flag);
   if (!HasFlag(cptr, FLAG_HIDDENHOST) || !HasFlag(cptr, FLAG_ACCOUNT))
     return 0;
@@ -1339,7 +1345,7 @@
   /* Maximum string size: "owidgrx\0" */
   char *m = umodeBuf;
   int i;
-  struct Flags c_flags;
+  struct Flags c_flags = cli_flags(cptr);
 
   if (HasPriv(cptr, PRIV_PROPAGATE))
     FlagSet(&c_flags, FLAG_OPER);
Index: ircu2.10/ircd/whocmds.c
diff -u ircu2.10/ircd/whocmds.c:1.17 ircu2.10/ircd/whocmds.c:1.18
--- ircu2.10/ircd/whocmds.c:1.17        Tue Jan  7 19:17:20 2003
+++ ircu2.10/ircd/whocmds.c     Tue Aug 12 02:41:17 2003
@@ -20,7 +20,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: whocmds.c,v 1.17 2003/01/08 03:17:20 klmitch Exp $
+ * $Id: whocmds.c,v 1.18 2003/08/12 09:41:17 denspike Exp $
  */
 #include "config.h"
 
@@ -159,8 +159,7 @@
       *(p1++) = 'G';
     else
       *(p1++) = 'H';
-    if (IsAnOper(acptr) &&
-       (HasPriv(acptr, PRIV_DISPLAY) || HasPriv(sptr, PRIV_SEE_OPERS)))
+    if SeeOper(sptr,acptr)
       *(p1++) = '*';
     if (fields) {
       /* If you specified flags then we assume you know how to parse
----------------------- End of diff -----------------------

Reply via email to