From 22b24f637d52e0abd3b39ac9d2ac1db4c04b9897 Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Wed, 2 Jan 2013 20:07:28 +0100 Subject: [PATCH] server: Move required CAPAB check after authentication and add snote and log. --- modules/core/m_server.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/core/m_server.c b/modules/core/m_server.c index d39902a1..a86ac573 100644 --- a/modules/core/m_server.c +++ b/modules/core/m_server.c @@ -109,16 +109,6 @@ mr_server(struct Client *client_p, struct Client *source_p, int parc, const char return 0; } - /* check to ensure any "required" caps are set. --nenolod */ - /* XXX: show required CAPABs. */ - required_mask = capability_index_get_required(serv_capindex); - if (!IsCapable(client_p, required_mask)) - { - exit_client(client_p, client_p, client_p, "Missing required CAPABs"); - - return 0; - } - /* Now we just have to call check_server and everything should be * check for us... -A1kmm. */ switch (check_server(name, client_p)) @@ -203,6 +193,21 @@ mr_server(struct Client *client_p, struct Client *source_p, int parc, const char return 0; } + /* check to ensure any "required" caps are set. --nenolod */ + /* XXX: show required CAPABs. */ + required_mask = capability_index_get_required(serv_capindex); + if (!IsCapable(client_p, required_mask)) + { + sendto_realops_snomask(SNO_GENERAL, is_remote_connect(client_p) ? L_NETWIDE : L_ALL, + "Link %s dropped, required CAPABs are missing", name); + ilog(L_SERVER, "Link %s%s dropped, required CAPABs are missing", + EmptyString(client_p->name) ? name : "", + log_client_name(client_p, SHOW_IP)); + exit_client(client_p, client_p, client_p, "Missing required CAPABs"); + + return 0; + } + if((target_p = find_server(NULL, name))) { /*