X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcommands%2Fcmd_oper.cpp;h=a98db6ca42b593cf02545a795b8217ae6a740a13;hb=1064b6732975ad32ac32147974a3af2d888a7e12;hp=1ce7dc49de541ed2295674966455a91e810fc063;hpb=ba0d375f7a28b529770791f4568d787aca6dcf96;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/commands/cmd_oper.cpp b/src/commands/cmd_oper.cpp index 1ce7dc49d..a98db6ca4 100644 --- a/src/commands/cmd_oper.cpp +++ b/src/commands/cmd_oper.cpp @@ -2,8 +2,8 @@ * | Inspire Internet Relay Chat Daemon | * +------------------------------------+ * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits + * InspIRCd: (C) 2002-2009 InspIRCd Development Team + * See: http://wiki.inspircd.org/Credits * * This program is free but copyrighted software; see * the file COPYING for details. @@ -12,7 +12,6 @@ */ #include "inspircd.h" -#include "wildcard.h" #include "commands/cmd_oper.h" #include "hashcomp.h" @@ -22,7 +21,7 @@ bool OneOfMatches(const char* host, const char* ip, const char* hostlist) std::string xhost; while (hl >> xhost) { - if (match(host, xhost) || match(ip,xhost, true)) + if (InspIRCd::Match(host, xhost, ascii_case_insensitive_map) || InspIRCd::MatchCIDR(ip, xhost, ascii_case_insensitive_map)) { return true; } @@ -80,7 +79,7 @@ CmdResult CommandOper::Handle (const std::vector& parameters, User if (!strcmp(TypeName,OperType)) { /* found this oper's opertype */ - if (!ServerInstance->IsNick(TypeName)) + if (!ServerInstance->IsNick(TypeName, ServerInstance->Config->Limits.NickMax)) { user->WriteNumeric(491, "%s :Invalid oper type (oper types must follow the same syntax as nicknames)",user->nick.c_str()); ServerInstance->SNO->WriteToSnoMask('o',"CONFIGURATION ERROR! Oper type '%s' contains invalid characters",OperType); @@ -107,10 +106,7 @@ CmdResult CommandOper::Handle (const std::vector& parameters, User if (found) { /* correct oper credentials */ - ServerInstance->SNO->WriteToSnoMask('o',"%s (%s@%s) is now an IRC operator of type %s (using oper '%s')", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), irc::Spacify(OperType), parameters[0].c_str()); - user->WriteNumeric(381, "%s :You are now %s %s",user->nick.c_str(), strchr("aeiouAEIOU", *OperType) ? "an" : "a", irc::Spacify(OperType)); - if (!user->IsModeSet('o')) - user->Oper(OperType, LoginName); + user->Oper(OperType, LoginName); } else { @@ -132,7 +128,7 @@ CmdResult CommandOper::Handle (const std::vector& parameters, User // tell them they suck, and lag them up to help prevent brute-force attacks user->WriteNumeric(491, "%s :Invalid oper credentials",user->nick.c_str()); user->IncreasePenalty(10); - + snprintf(broadcast, MAXBUF, "WARNING! Failed oper attempt by %s!%s@%s using login '%s': The following fields do not match: %s", user->nick.c_str(), user->ident.c_str(), user->host.c_str(), parameters[0].c_str(), fields.c_str()); ServerInstance->SNO->WriteToSnoMask('o',std::string(broadcast)); ServerInstance->PI->SendSNONotice("o", std::string("OPER: ") + broadcast); @@ -154,4 +150,3 @@ CmdResult CommandOper::Handle (const std::vector& parameters, User } return CMD_SUCCESS; } -