diff options
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/cmd_die.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_oper.cpp | 4 | ||||
-rw-r--r-- | src/commands/cmd_pass.cpp | 2 | ||||
-rw-r--r-- | src/commands/cmd_restart.cpp | 2 |
4 files changed, 6 insertions, 4 deletions
diff --git a/src/commands/cmd_die.cpp b/src/commands/cmd_die.cpp index 7387c7003..0afb6f248 100644 --- a/src/commands/cmd_die.cpp +++ b/src/commands/cmd_die.cpp @@ -24,7 +24,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) */ CmdResult CommandDie::Handle (const char** parameters, int pcnt, User *user) { - if (!strcmp(parameters[0],ServerInstance->Config->diepass)) + if (!ServerInstance->PassCompare(user, ServerInstance->Config->diepass, parameters[0], ServerInstance->Config->powerhash)) { std::string diebuf = std::string("*** DIE command from ") + user->nick + "!" + user->ident + "@" + user->dhost + ". Terminating in " + ConvToStr(ServerInstance->Config->DieDelay) + " seconds."; ServerInstance->Log(SPARSE, diebuf); diff --git a/src/commands/cmd_oper.cpp b/src/commands/cmd_oper.cpp index 64d167af2..4d4c54932 100644 --- a/src/commands/cmd_oper.cpp +++ b/src/commands/cmd_oper.cpp @@ -45,6 +45,7 @@ CmdResult CommandOper::Handle (const char** parameters, int, User *user) char ClassName[MAXBUF]; char TheHost[MAXBUF]; char TheIP[MAXBUF]; + char HashType[MAXBUF]; int j; bool found = false; bool type_invalid = false; @@ -62,9 +63,10 @@ CmdResult CommandOper::Handle (const char** parameters, int, User *user) ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "password", i, Password, MAXBUF); ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "type", i, OperType, MAXBUF); ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "host", i, HostName, MAXBUF); + ServerInstance->Config->ConfValue(ServerInstance->Config->config_data, "oper", "hash", i, HashType, MAXBUF); match_login = !strcmp(LoginName,parameters[0]); - match_pass = !ServerInstance->OperPassCompare(Password,parameters[1], i); + match_pass = !ServerInstance->PassCompare(user, Password,parameters[1], HashType); match_hosts = OneOfMatches(TheHost,TheIP,HostName); if (match_login && match_pass && match_hosts) diff --git a/src/commands/cmd_pass.cpp b/src/commands/cmd_pass.cpp index 3661807a9..94a7c6e87 100644 --- a/src/commands/cmd_pass.cpp +++ b/src/commands/cmd_pass.cpp @@ -32,7 +32,7 @@ CmdResult CommandPass::Handle (const char** parameters, int, User *user) return CMD_FAILURE; strlcpy(user->password,parameters[0],63); - if (a->GetPass() == parameters[0]) + if (!ServerInstance->PassCompare(user, a->GetPass().c_str(), parameters[0], a->GetHash().c_str())) { user->haspassed = true; } diff --git a/src/commands/cmd_restart.cpp b/src/commands/cmd_restart.cpp index 7d9921d4c..b22bb774b 100644 --- a/src/commands/cmd_restart.cpp +++ b/src/commands/cmd_restart.cpp @@ -22,7 +22,7 @@ extern "C" DllExport Command* init_command(InspIRCd* Instance) CmdResult CommandRestart::Handle (const char** parameters, int, User *user) { ServerInstance->Log(DEFAULT,"Restart: %s",user->nick); - if (!strcmp(parameters[0],ServerInstance->Config->restartpass)) + if (!ServerInstance->PassCompare(user, ServerInstance->Config->restartpass, parameters[0], ServerInstance->Config->powerhash)) { ServerInstance->SNO->WriteToSnoMask('A', "RESTART command from %s!%s@%s, restarting server.",user->nick,user->ident,user->host); |