+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
" NICKLEN=%i"
-#define FEATURES2 " MAXNICKLEN=%i" \
+#define FEATURES2 "MAXNICKLEN=%i" \
" TOPICLEN=%i" \
" AWAYLEN=%i" \
" KICKLEN=%i" \
#include "ircd_features.h"
#include "ircd_log.h"
#include "ircd_reply.h"
+#include "match.h"
#include "msg.h"
#include "numeric.h"
#include "numnicks.h"
*/
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);
#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;
}