CVSROOT    : /home/coder-com/cvs
Module     : ircu2.10
Branch tags: u2_10_11
Commit time: 2002-08-28 12:27:39 UTC

Modified files:
  Tag: u2_10_11
     ChangeLog ircd/m_gline.c

Log message:

Author: Kev <[EMAIL PROTECTED]>
Log message:

Clean up G-line permissions checking a bit.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.290.2.119 ircu2.10/ChangeLog:1.290.2.120
--- ircu2.10/ChangeLog:1.290.2.119      Tue Aug 27 18:52:24 2002
+++ ircu2.10/ChangeLog  Wed Aug 28 07:27:29 2002
@@ -1,3 +1,10 @@
+2002-08-28  Kevin L Mitchell  <[EMAIL PROTECTED]>
+
+       * ircd/m_gline.c: trust remote servers to include ! for wide
+       glines only if its operator has the WIDE_GLINE privilege; check
+       gline addition/modification privilege after verifying that gline
+       is enabled, rather than in-line with the target tests
+
 2002-08-27  Kevin L Mitchell  <[EMAIL PROTECTED]>
 
        * ircd/m_settime.c (ms_settime): SETTIME != NOTICE
Index: ircu2.10/ircd/m_gline.c
diff -u ircu2.10/ircd/m_gline.c:1.22.2.1 ircu2.10/ircd/m_gline.c:1.22.2.2
--- ircu2.10/ircd/m_gline.c:1.22.2.1    Sat Jul 13 14:18:05 2002
+++ ircu2.10/ircd/m_gline.c     Wed Aug 28 07:27:29 2002
@@ -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_gline.c,v 1.22.2.1 2002/07/13 19:18:05 kev Exp $
+ * $Id: m_gline.c,v 1.22.2.2 2002/08/28 12:27:29 kev Exp $
  */
 
 /*
@@ -131,8 +131,7 @@
   if (*mask == '!') {
     mask++;
 
-    if (HasPriv(sptr, PRIV_WIDE_GLINE))
-      flags |= GLINE_OPERFORCE;
+    flags |= GLINE_OPERFORCE; /* assume oper had WIDE_GLINE */
   }
 
   if ((parc == 3 && *mask == '-') || parc == 5) {
@@ -281,16 +280,17 @@
                      flags & GLINE_ACTIVE ? '+' : '-', mask, parv[3],
                      TStime(), reason);
        return 0;
-      } else if (!HasPriv(sptr, PRIV_LOCAL_GLINE))
-       return send_reply(sptr, ERR_NOPRIVILEGES);
+      }
 
       flags |= GLINE_LOCAL;
-    } else if (!HasPriv(sptr, PRIV_GLINE))
-      return send_reply(sptr, ERR_NOPRIVILEGES);
+    }
   }
 
   if (!(flags & GLINE_LOCAL) && !feature_bool(FEAT_CONFIG_OPERCMDS))
     return send_reply(sptr, ERR_DISABLED, "GLINE");
+
+  if (!HasPriv(sptr, (flags & GLINE_LOCAL ? PRIV_LOCAL_GLINE : PRIV_GLINE)))
+    return send_reply(sptr, ERR_NOPRIVILEGES);
 
   agline = gline_find(mask, GLINE_ANY | GLINE_EXACT);
 
----------------------- End of diff -----------------------

Reply via email to