From: Michael Poole Date: Sun, 20 May 2007 13:02:51 +0000 (+0000) Subject: Fix bugs reported in SF#1691357. X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=7f48cc0de8ff330c053e69f99459eb0e7e8102de Fix bugs reported in SF#1691357. 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 --- diff --git a/ChangeLog b/ChangeLog index da72be6..f823fb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-05-20 Michael Poole + + * 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 * ircd/m_gline.c: fix minor typo in code that forwards remote diff --git a/include/supported.h b/include/supported.h index 3cb99f6..b3a8ac0 100644 --- a/include/supported.h +++ b/include/supported.h @@ -45,7 +45,7 @@ " NICKLEN=%i" -#define FEATURES2 " MAXNICKLEN=%i" \ +#define FEATURES2 "MAXNICKLEN=%i" \ " TOPICLEN=%i" \ " AWAYLEN=%i" \ " KICKLEN=%i" \ diff --git a/ircd/m_admin.c b/ircd/m_admin.c index bfaa78c..8c4908e 100644 --- a/ircd/m_admin.c +++ b/ircd/m_admin.c @@ -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); diff --git a/ircd/m_version.c b/ircd/m_version.c index 340991b..656332e 100644 --- a/ircd/m_version.c +++ b/ircd/m_version.c @@ -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; }