Fix bugs reported in SF#1691357.
authorMichael Poole <mdpoole@troilus.org>
Sun, 20 May 2007 13:02:51 +0000 (13:02 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sun, 20 May 2007 13:02:51 +0000 (13:02 +0000)
Remove extra space in FEATURES 2; do not leak linked-server information.

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

ChangeLog
include/supported.h
ircd/m_admin.c
ircd/m_version.c

index da72be68316042edd780d6a6cb03bac34a68bb57..f823fb14c64a91ef38c21c0b976da8a53f057242 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-05-20  Michael Poole <mdpoole@troilus.org>
+
+       * 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  <klmitch@mit.edu>
 
        * ircd/m_gline.c: fix minor typo in code that forwards remote
index 3cb99f67f4c5c9f052dd8a764e4efdfbb99bcbfc..b3a8ac00fb2cc84e43c688dd71e8b531ba3b4b8d 100644 (file)
@@ -45,7 +45,7 @@
                 " NICKLEN=%i"
                 
 
-#define FEATURES2 " MAXNICKLEN=%i" \
+#define FEATURES2 "MAXNICKLEN=%i" \
                 " TOPICLEN=%i" \
                 " AWAYLEN=%i" \
                 " KICKLEN=%i" \
index bfaa78c46e5b5c14bf172c50694d3aca2bd57509..8c4908ec8d59c3ec14af3042a1ffdd001bad409e 100644 (file)
@@ -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 @@ static int send_admin_info(struct Client* sptr)
  */
 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 340991b81ccf114aa6911c940f3c5023d3f85bd9..656332e3a5bdc8e931975ff8166591c73b2fd992 100644 (file)
@@ -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"
  */
 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;
 }