Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Branch tags: u2_10_12_branch
Commit time: 2007-05-20 13:03:02 UTC

Modified files:
  Tag: u2_10_12_branch
     ircd/m_version.c ircd/m_admin.c include/supported.h ChangeLog

Log message:

Fix bugs reported in SF#1691357.
Remove extra space in FEATURES 2; do not leak linked-server information.

---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.710.2.181 ircu2.10/ChangeLog:1.710.2.182
--- ircu2.10/ChangeLog:1.710.2.181      Sun Apr 15 12:14:40 2007
+++ ircu2.10/ChangeLog  Sun May 20 06:02:51 2007
@@ -1,3 +1,13 @@
+2007-05-20  Michael Poole <[EMAIL PROTECTED]>
+
+       * include/supported.h (FEATURES2): Remove extra space.
+
+       * ircd/m_admin.c (m_admin): Only check server mask against our
+       name, so that it cannot leak information about other linked
+       servers.
+
+       * ircd/m_version.c (m_version): Likewise.
+       
 2007-04-15  Kevin L. Mitchell  <[EMAIL PROTECTED]>
 
        * ircd/m_gline.c: fix minor typo in code that forwards remote
Index: ircu2.10/include/supported.h
diff -u ircu2.10/include/supported.h:1.20.2.1 
ircu2.10/include/supported.h:1.20.2.2
--- ircu2.10/include/supported.h:1.20.2.1       Mon Jan 22 17:57:56 2007
+++ ircu2.10/include/supported.h        Sun May 20 06:02:51 2007
@@ -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: supported.h,v 1.20.2.1 2007/01/23 01:57:56 entrope Exp $
+ * $Id: supported.h,v 1.20.2.2 2007/05/20 13:02:51 entrope Exp $
  *
  * Description: This file has the featureset that ircu announces on connecting
  *              a client.  It's in this .h because it's likely to be appended
@@ -45,7 +45,7 @@
                 " NICKLEN=%i"
                 
 
-#define FEATURES2 " MAXNICKLEN=%i" \
+#define FEATURES2 "MAXNICKLEN=%i" \
                 " TOPICLEN=%i" \
                 " AWAYLEN=%i" \
                 " KICKLEN=%i" \
Index: ircu2.10/ircd/m_admin.c
diff -u ircu2.10/ircd/m_admin.c:1.13 ircu2.10/ircd/m_admin.c:1.13.2.1
--- ircu2.10/ircd/m_admin.c:1.13        Fri Dec 10 21:13:46 2004
+++ ircu2.10/ircd/m_admin.c     Sun May 20 06:02:51 2007
@@ -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_admin.c,v 1.13 2004/12/11 05:13:46 klmitch Exp $
+ * $Id: m_admin.c,v 1.13.2.1 2007/05/20 13:02:51 entrope Exp $
  */
 
 /*
@@ -87,6 +87,7 @@
 #include "ircd_features.h"
 #include "ircd_log.h"
 #include "ircd_reply.h"
+#include "match.h"
 #include "msg.h"
 #include "numeric.h"
 #include "numnicks.h"
@@ -116,12 +117,10 @@
  */
 int m_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 {
-  struct Client *acptr;
-
   assert(0 != cptr);
   assert(cptr == sptr);
 
-  if (parc > 1  && (!(acptr = find_match_server(parv[1])) || !IsMe(acptr)))
+  if (parc > 1  && match(parv[1], cli_name(&me)))
     return send_reply(sptr, ERR_NOPRIVILEGES);
 
   return send_admin_info(sptr);
Index: ircu2.10/ircd/m_version.c
diff -u ircu2.10/ircd/m_version.c:1.16 ircu2.10/ircd/m_version.c:1.16.2.1
--- ircu2.10/ircd/m_version.c:1.16      Fri Dec 10 21:14:03 2004
+++ ircu2.10/ircd/m_version.c   Sun May 20 06:02:51 2007
@@ -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_version.c,v 1.16 2004/12/11 05:14:03 klmitch Exp $
+ * $Id: m_version.c,v 1.16.2.1 2007/05/20 13:02:51 entrope Exp $
  */
 
 /*
@@ -89,6 +89,7 @@
 #include "ircd_reply.h"
 #include "ircd_snprintf.h"
 #include "ircd_string.h"
+#include "match.h"
 #include "msg.h"
 #include "numeric.h"
 #include "numnicks.h"
@@ -108,15 +109,12 @@
  */
 int m_version(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 {
-  struct Client *acptr;
-  if (parc > 1 && (!(acptr = find_match_server(parv[1])) || !IsMe(acptr)))
-    send_reply(sptr, ERR_NOPRIVILEGES);
-  else
-  {
-    send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
-               debug_serveropts());
-    send_supported(sptr);
-  }
+  if (parc > 1 && match(parv[1], cli_name(&me)))
+    return send_reply(sptr, ERR_NOPRIVILEGES);
+
+  send_reply(sptr, RPL_VERSION, version, debugmode, cli_name(&me),
+             debug_serveropts());
+  send_supported(sptr);
   return 0;
 }
 
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to