From 1f2b4e2541df088f879a8d5cfcc65687dc6b78f1 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 10 May 2007 14:23:16 +0000 Subject: Fix for bug #281, oper fail notices should be global git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6955 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/cmd_oper.cpp | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/cmd_oper.cpp b/src/cmd_oper.cpp index 7c7ab391e..59b35deba 100644 --- a/src/cmd_oper.cpp +++ b/src/cmd_oper.cpp @@ -108,6 +108,10 @@ CmdResult cmd_oper::Handle (const char** parameters, int pcnt, userrec *user) } else { + std::deque n; + n.push_back("o"); + char broadcast[MAXBUF]; + if (!type_invalid) { std::string fields = ""; @@ -118,14 +122,27 @@ CmdResult cmd_oper::Handle (const char** parameters, int pcnt, userrec *user) if (!match_hosts) fields.append("hosts"); user->WriteServ("491 %s :Invalid oper credentials",user->nick); - ServerInstance->SNO->WriteToSnoMask('o',"WARNING! Failed oper attempt by %s!%s@%s using login '%s': The following fields do not match: %s",user->nick,user->ident,user->host, parameters[0], fields.c_str()); + + snprintf(broadcast, MAXBUF, "WARNING! Failed oper attempt by %s!%s@%s using login '%s': The following fields do not match: %s",user->nick,user->ident,user->host, parameters[0], fields.c_str()); + ServerInstance->SNO->WriteToSnoMask('o',std::string(broadcast)); + n.push_back(broadcast); + Event rmode2((char *)&n, NULL, "send_snoset"); + rmode2.Send(ServerInstance); + ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': The following fields did not match: %s",user->nick,user->ident,user->host,parameters[0],fields.c_str()); return CMD_FAILURE; } else { user->WriteServ("491 %s :Your oper block does not have a valid opertype associated with it",user->nick); - ServerInstance->SNO->WriteToSnoMask('o',"CONFIGURATION ERROR! Oper block '%s': missing OperType %s",parameters[0],OperType); + + snprintf(broadcast, MAXBUF, "CONFIGURATION ERROR! Oper block '%s': missing OperType %s",parameters[0],OperType); + + ServerInstance->SNO->WriteToSnoMask('o', std::string(broadcast)); + n.push_back(broadcast); + Event rmode2((char *)&n, NULL, "send_snoset"); + rmode2.Send(ServerInstance); + ServerInstance->Log(DEFAULT,"OPER: Failed oper attempt by %s!%s@%s using login '%s': credentials valid, but oper type nonexistent.",user->nick,user->ident,user->host,parameters[0]); return CMD_FAILURE; } -- cgit v1.2.3