X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_restart.c;h=08246db0b32fd07e6fd4ed012b6fdd286eb2255d;hb=refs%2Fheads%2Fupstream;hp=11d71e96f656f8b58097a0af4ed39b7df690d7b4;hpb=36ab1bb01f9a0f5f630f3098b1afdc5ccc937fa6;p=ircu2.10.12-pk.git diff --git a/ircd/m_restart.c b/ircd/m_restart.c index 11d71e9..08246db 100644 --- a/ircd/m_restart.c +++ b/ircd/m_restart.c @@ -79,14 +79,8 @@ * note: it is guaranteed that parv[0]..parv[parc-1] are all * non-NULL pointers. */ -#if 0 -/* - * No need to include handlers.h here the signatures must match - * and we don't need to force a rebuild of all the handlers everytime - * we add a new one to the list. --Bleep - */ -#include "handlers.h" -#endif /* 0 */ +#include "config.h" + #include "client.h" #include "ircd.h" #include "ircd_log.h" @@ -96,59 +90,18 @@ #include "numnicks.h" #include "send.h" -#include +/* #include -- Now using assert in ircd_log.h */ /* * mo_restart - oper message handler */ int mo_restart(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { -#if defined(OPER_RESTART) || defined(LOCOP_RESTART) -#ifndef LOCOP_RESTART - if (!MyUser(sptr) || !IsOper(sptr)) -#else -#ifdef OPER_RESTART - if (!MyUser(sptr) || !IsAnOper(sptr)) -#else - if (!MyUser(sptr) || !IsLocOp(sptr)) -#endif -#endif - { - send_reply(sptr, ERR_NOPRIVILEGES); - return 0; - } - ircd_log(L_NOTICE, "Server RESTART by %s\n", get_client_name(sptr, HIDE_IP)); - server_restart("received RESTART"); - -#endif /* defined(OPER_RESTART) || defined(LOCOP_RESTART) */ - return 0; -} - + if (!HasPriv(sptr, PRIV_RESTART)) + return send_reply(sptr, ERR_NOPRIVILEGES); -#if 0 -#if defined(OPER_RESTART) || defined(LOCOP_RESTART) -/* - * m_restart - */ -int m_restart(struct Client *cptr, struct Client *sptr, int parc, - char *parv[]) -{ -#ifndef LOCOP_RESTART - if (!MyUser(sptr) || !IsOper(sptr)) -#else -#ifdef OPER_RESTART - if (!MyUser(sptr) || !IsAnOper(sptr)) -#else - if (!MyUser(sptr) || !IsLocOp(sptr)) -#endif -#endif - { - sendto_one(sptr, err_str(ERR_NOPRIVILEGES), me.name, parv[0]); /* XXX DEAD */ - return 0; - } - ircd_log(L_NOTICE, "Server RESTART by %s\n", get_client_name(sptr, HIDE_IP)); + log_write(LS_SYSTEM, L_NOTICE, 0, "Server RESTART by %#C", sptr); server_restart("received RESTART"); + return 0; } -#endif -#endif /* 0 */