From a9ced70eed74808eb18cc9d1b7b1f54ed93a8844 Mon Sep 17 00:00:00 2001 From: cyberbotx Date: Mon, 23 Mar 2009 00:55:22 +0000 Subject: Add opertype access checks to OS QUIT, OS RESTART, and OS SHUTDOWN, patch from Adam. git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2191 5417fbe8-f217-4b02-8779-1006273d7864 --- src/core/os_quit.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/core/os_quit.c') diff --git a/src/core/os_quit.c b/src/core/os_quit.c index 7639ed9de..6d9fc4f4d 100644 --- a/src/core/os_quit.c +++ b/src/core/os_quit.c @@ -26,6 +26,11 @@ class CommandOSQuit : public Command CommandReturn Execute(User *u, std::vector ¶ms) { + if (!u->nc->HasCommand("operserv/quit")) { + notice_lang(s_OperServ, u, PERMISSION_DENIED); + return MOD_STOP; + } + quitmsg = new char[28 + strlen(u->nick)]; if (!quitmsg) quitmsg = "QUIT command received, but out of memory!"; @@ -40,7 +45,7 @@ class CommandOSQuit : public Command bool OnHelp(User *u, const std::string &subcommand) { - if (!is_services_root(u)) + if (!u->nc->HasCommand("operserv/quit")) return false; notice_help(s_OperServ, u, OPER_HELP_QUIT); -- cgit