From 0c6d8d5a811c67955dd40ad0a4e279a21f2cd3cd Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Fri, 14 Apr 2000 17:37:01 +0000 Subject: [PATCH] Author: Kev Log message: Added CONFIG_OPERCMDS to switch things on and off; makes the task of a two- phase upgrade much simpler. Using ERR_DISABLED to indicate disabled commands. Also some minor cleanups and removal of dead code in m_gline.c and gline.c. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@173 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 31 +- config/config-sh.in | 3 +- doc/Configure.help | 11 +- include/numeric.h | 3 +- ircd/gline.c | 245 +--------- ircd/m_clearmode.c | 4 + ircd/m_gline.c | 1034 +------------------------------------------ ircd/m_jupe.c | 2 + ircd/m_opmode.c | 4 + ircd/parse.c | 4 + ircd/s_err.c | 2 +- 11 files changed, 71 insertions(+), 1272 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14ad56c..ffd711d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,34 @@ 2000-04-14 Kevin L. Mitchell + * ircd/gline.c: remove old, dead code. + + * ircd/m_gline.c (mo_gline): disallow setting of global G-lines + unless CONFIG_OPERCMDS is enabled; disallow listing of all G-lines + (don't advertise proxies); remove dead code + + * ircd/parse.c: oper handler for JUPE only lists jupes unless + CONFIG_OPERCMDS is enabled + + * ircd/m_jupe.c (mo_jupe): don't compile mo_jupe() if + CONFIG_OPERCMDS is not enabled; we'll disable it in parse.c + + * ircd/m_opmode.c (mo_opmode): if CONFIG_OPERCMDS is not enabled, + always return ERR_DISABLED + + * ircd/m_clearmode.c (mo_clearmode): if CONFIG_OPERCMDS is not + enabled, always return ERR_DISABLED + + * ircd/s_err.c: add error message to indicate disabled commands + + * include/numeric.h (ERR_DISABLED): to indicate disabled commands + + * doc/Configure.help: add documentation for CONFIG_OPERCMDS + + * config/config-sh.in: add CONFIG_OPERCMDS, default both it and + CONFIG_NEW_MODE to 'y' for now + + * ircd/gline.c (gline_list): fix a minor formatting bogon + * BUGS: since I fixed that bug, might as well mark it fixed. * ircd/m_join.c: look up badchans with GLINE_EXACT @@ -466,7 +495,7 @@ # # ChangeLog for ircu2.10.11 # -# $Id: ChangeLog,v 1.84 2000-04-14 17:08:06 kev Exp $ +# $Id: ChangeLog,v 1.85 2000-04-14 17:37:00 kev Exp $ # # Insert new changes at beginning of the change list. # diff --git a/config/config-sh.in b/config/config-sh.in index 52d40bd..7314d2a 100644 --- a/config/config-sh.in +++ b/config/config-sh.in @@ -390,5 +390,6 @@ endmenu mainmenu_option next_comment comment 'Experimental options (Do you know what you'\''re doing?)' - bool 'Use new MODE implementation' CONFIG_NEW_MODE + bool 'Use new MODE implementation' CONFIG_NEW_MODE y + bool 'Use new oper commands (JUPE, CLEARMODE, OPMODE, GLINE)' CONFIG_OPERCMDS y endmenu diff --git a/doc/Configure.help b/doc/Configure.help index 7ade6af..ae51a32 100644 --- a/doc/Configure.help +++ b/doc/Configure.help @@ -1066,4 +1066,13 @@ DEFAULTMAXSENDQLENGTH Use new MODE implementation CONFIG_NEW_MODE This enables a new implementation of m_mode. THIS IS AN EXPERIMENTAL - FEATURE; DO NOT ENABLE UNLESS YOU KNOW WHAT YOU ARE DOING! + FEATURE; DO NOT ENABLE UNLESS YOU KNOW WHAT YOU ARE DOING! Note that, + due to apparent stability, this new implementation has been enabled. + +Use new oper commands (JUPE, CLEARMODE, OPMODE, GLINE) +CONFIG_OPERCMDS + Several new oper-only commands were added to the server source + during the Uworld integration project. Until all servers are + upgraded to versions that understand the new server<->server + traffic, they must remain disabled, however. This option activates + the client-side part of those changes. diff --git a/include/numeric.h b/include/numeric.h index eee9e3f..7cfda74 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -368,6 +368,7 @@ extern const struct Numeric* get_error_numeric(int err); #define ERR_NOSUCHJUPE 514 /* Undernet extension - jupe -Kev */ #define ERR_BADEXPIRE 515 /* Undernet extension - jupe -Kev */ #define ERR_DONTCHEAT 516 /* Undernet extension */ -#define ERR_LASTERROR 517 +#define ERR_DISABLED 517 /* Undernet extension -Kev */ +#define ERR_LASTERROR 518 #endif /* INCLUDED_numeric_h */ diff --git a/ircd/gline.c b/ircd/gline.c index 1601c5f..61f4904 100644 --- a/ircd/gline.c +++ b/ircd/gline.c @@ -480,10 +480,8 @@ gline_list(struct Client *sptr, char *userhost) struct Gline *sgline; if (userhost) { - if (!(gline = gline_find(userhost, GLINE_ANY))) { /* no such gline */ - send_error_to_client(sptr, ERR_NOSUCHGLINE, userhost); - return 0; - } + if (!(gline = gline_find(userhost, GLINE_ANY))) /* no such gline */ + return send_error_to_client(sptr, ERR_NOSUCHGLINE, userhost); /* send gline information along */ sendto_one(sptr, rpl_str(RPL_GLIST), me.name, sptr->name, gline->gl_user, @@ -498,8 +496,8 @@ gline_list(struct Client *sptr, char *userhost) if (gline->gl_expire <= TStime()) gline_free(gline); else - sendto_one(sptr, rpl_str(RPL_GLIST), me.name, sptr->name, gline->gl_user, - "@", gline->gl_host, gline->gl_expire, + sendto_one(sptr, rpl_str(RPL_GLIST), me.name, sptr->name, + gline->gl_user, "@", gline->gl_host, gline->gl_expire, GlineIsLocal(gline) ? me.name : "*", GlineIsActive(gline) ? '+' : '-', gline->gl_reason); } @@ -510,8 +508,8 @@ gline_list(struct Client *sptr, char *userhost) if (gline->gl_expire <= TStime()) gline_free(gline); else - sendto_one(sptr, rpl_str(RPL_GLIST), me.name, sptr->name, gline->gl_user, - "", "", gline->gl_expire, + sendto_one(sptr, rpl_str(RPL_GLIST), me.name, sptr->name, + gline->gl_user, "", "", gline->gl_expire, GlineIsLocal(gline) ? me.name : "*", GlineIsActive(gline) ? '+' : '-', gline->gl_reason); } @@ -539,234 +537,3 @@ gline_stats(struct Client *sptr) gline->gl_reason); } } - - -#if 0 /* forget about it! */ -struct Gline *make_gline(int is_ipmask, char *host, char *reason, - char *name, time_t expire) -{ - struct Gline *agline; - -#ifdef BADCHAN - int gtype = 0; - if ('#' == *host || '&' == *host || '+' == *host) - gtype = 1; /* BAD CHANNEL GLINE */ -#endif - - agline = (struct Gline*) MyMalloc(sizeof(struct Gline)); /* alloc memory */ - assert(0 != agline); - DupString(agline->host, host); /* copy vital information */ - DupString(agline->reason, reason); - DupString(agline->name, name); - agline->expire = expire; - agline->gflags = GLINE_ACTIVE; /* gline is active */ - if (is_ipmask) - SetGlineIsIpMask(agline); -#ifdef BADCHAN - if (gtype) - { - agline->next = BadChanGlineList; /* link it into the list */ - return (BadChanGlineList = agline); - } -#endif - agline->next = GlobalGlineList; /* link it into the list */ - return (GlobalGlineList = agline); -} - -struct Gline *find_gline(struct Client *cptr, struct Gline **pgline) -{ - struct Gline* gline = GlobalGlineList; - struct Gline* prev = 0; - - while (gline) { - /* - * look through all glines - */ - if (gline->expire <= TStime()) { - /* - * handle expired glines - */ - free_gline(gline, prev); - gline = prev ? prev->next : GlobalGlineList; - if (!gline) - break; /* gline == NULL means gline == NULL */ - continue; - } - - /* Does gline match? */ - /* Added a check against the user's IP address as well -Kev */ - if ((GlineIsIpMask(gline) ? - match(gline->host, ircd_ntoa((const char*) &cptr->ip)) : - match(gline->host, cptr->sockhost)) == 0 && - match(gline->name, cptr->user->username) == 0) { - if (pgline) - *pgline = prev; /* If they need it, give them the previous gline - entry (probably for free_gline, below) */ - return gline; - } - - prev = gline; - gline = gline->next; - } - - return 0; /* found no glines */ -} - -void free_gline(struct Gline* gline, struct Gline* prev) -{ - assert(0 != gline); - if (prev) - prev->next = gline->next; /* squeeze agline out */ - else { -#ifdef BADCHAN - assert(0 != gline->host); - if ('#' == *gline->host || - '&' == *gline->host || - '+' == *gline->host) { - BadChanGlineList = gline->next; - } - else -#endif - GlobalGlineList = gline->next; - } - - MyFree(gline->host); /* and free up the memory */ - MyFree(gline->reason); - MyFree(gline->name); - MyFree(gline); -} - -void gline_remove_expired(time_t now) -{ - struct Gline* gline; - struct Gline* prev = 0; - - for (gline = GlobalGlineList; gline; gline = gline->next) { - if (gline->expire < now) { - free_gline(gline, prev); - gline = (prev) ? prev : GlobalGlineList; - if (!gline) - break; - continue; - } - prev = gline; - } -} - -#ifdef BADCHAN -int bad_channel(const char* name) -{ - struct Gline* agline = BadChanGlineList; - - while (agline) - { - if ((agline->gflags & GLINE_ACTIVE) && (agline->expire > TStime()) && - !mmatch(agline->host, name)) { - return 1; - } - agline = agline->next; - } - return 0; -} - -void bad_channel_remove_expired(time_t now) -{ - struct Gline* gline; - struct Gline* prev = 0; - - for (gline = BadChanGlineList; gline; gline = gline->next) { - if (gline->expire < now) { - free_gline(gline, prev); - gline = (prev) ? prev : BadChanGlineList; - if (!gline) - break; - continue; - } - prev = gline; - } -} - -#endif - - -void add_gline(struct Client *sptr, int ip_mask, char *host, char *comment, - char *user, time_t expire, int local) -{ - struct Client *acptr; - struct Gline *agline; - int fd; - int gtype = 0; - assert(0 != host); - -#ifdef BADCHAN - if ('#' == *host || '&' == *host || '+' == *host) - gtype = 1; /* BAD CHANNEL */ -#endif - - /* Inform ops */ - sendto_op_mask(SNO_GLINE, - "%s adding %s%s for %s@%s, expiring at " TIME_T_FMT ": %s", sptr->name, - local ? "local " : "", - gtype ? "BADCHAN" : "GLINE", user, host, expire, comment); - -#ifdef GPATH - write_log(GPATH, - "# " TIME_T_FMT " %s adding %s %s for %s@%s, expiring at " TIME_T_FMT - ": %s\n", TStime(), sptr->name, local ? "local" : "global", - gtype ? "BADCHAN" : "GLINE", user, host, expire, comment); - - /* this can be inserted into the conf */ - if (!gtype) - write_log(GPATH, "%c:%s:%s:%s\n", ip_mask ? 'k' : 'K', host, comment, - user); -#endif /* GPATH */ - - agline = make_gline(ip_mask, host, comment, user, expire); - if (local) - SetGlineIsLocal(agline); - -#ifdef BADCHAN - if (gtype) - return; -#endif - - for (fd = HighestFd; fd >= 0; --fd) { - /* - * get the users! - */ - if ((acptr = LocalClientArray[fd])) { - if (!acptr->user) - continue; -#if 0 - /* - * whee!! :) - */ - if (!acptr->user || strlen(acptr->sockhost) > HOSTLEN || - (acptr->user->username ? strlen(acptr->user->username) : 0) > HOSTLEN) - continue; /* these tests right out of - find_kill for safety's sake */ -#endif - - if ((GlineIsIpMask(agline) ? match(agline->host, acptr->sock_ip) : - match(agline->host, acptr->sockhost)) == 0 && - (!acptr->user->username || - match(agline->name, acptr->user->username) == 0)) - { - - /* ok, he was the one that got G-lined */ - sendto_one(acptr, ":%s %d %s :*** %s.", me.name, - ERR_YOUREBANNEDCREEP, acptr->name, agline->reason); - - /* let the ops know about my first kill */ - sendto_op_mask(SNO_GLINE, "G-line active for %s", - get_client_name(acptr, FALSE)); - - /* and get rid of him */ - if (sptr != acptr) - exit_client_msg(sptr->from, acptr, &me, "G-lined (%s)", agline->reason); - } - } - } -} - -#endif /* 0 */ diff --git a/ircd/m_clearmode.c b/ircd/m_clearmode.c index 4ae5f26..aeb2e9e 100644 --- a/ircd/m_clearmode.c +++ b/ircd/m_clearmode.c @@ -295,6 +295,9 @@ ms_clearmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) int mo_clearmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { +#ifndef CONFIG_OPERCMDS + return send_error_to_client(sptr, ERR_DISABLED, "CLEARMODE"); +#else struct Channel *chptr; char *control = "ovpsmikbl"; /* default control string */ @@ -313,4 +316,5 @@ mo_clearmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) return send_error_to_client(sptr, ERR_NOSUCHCHANNEL, parv[1]); return do_clearmode(cptr, sptr, chptr, control); +#endif /* CONFIG_OPERCMDS */ } diff --git a/ircd/m_gline.c b/ircd/m_gline.c index 5ba85ac..1fa1621 100644 --- a/ircd/m_gline.c +++ b/ircd/m_gline.c @@ -279,6 +279,11 @@ mo_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) } } +#ifndef CONFIG_OPERCMDS + if (!(flags & GLINE_LOCAL)) + return send_error_to_client(sptr, ERR_DISABLED, "GLINE"); +#endif /* CONFIG_OPERCMDS */ + agline = gline_find(mask, GLINE_ANY | GLINE_EXACT); if (agline) { @@ -308,1034 +313,7 @@ int m_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) { if (parc < 2) - return gline_list(sptr, 0); + return send_error_to_client(sptr, ERR_NOSUCHGLINE, ""); return gline_list(sptr, parv[1]); } - -#if 0 -/* - * ms_gline - server message handler - * - * parv[0] = Send prefix - * - * From server: - * - * parv[1] = Target: server numeric - * parv[2] = [+|-] - * parv[3] = Expiration offset - * parv[4] = Comment - * - * From client: - * - * parv[1] = [+|-] - * parv[2] = Expiration offset - * parv[3] = Comment - * - */ -int ms_gline(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) -{ - struct Client* acptr = 0; /* Init. to avoid compiler warning. */ - struct Gline* gline; - struct Gline* prev; - char* user; - char* host; - int active; - int ip_mask; - int gtype = 0; - time_t expire = 0; - - /* - * Remove expired G-lines - */ - gline_remove_expired(TStime()); -#ifdef BADCHAN - /* - * Remove expired bad channels - */ - bad_channel_remove_expired(TStime()); -#endif - - if (IsServer(cptr)) { - if (find_conf_byhost(cptr->confs, sptr->name, CONF_UWORLD)) { - if (parc < 3 || (*parv[2] != '-' && (parc < 5 || *parv[4] == '\0'))) - return need_more_params(sptr, "GLINE"); - - if (*parv[2] == '-') /* add mode or delete mode? */ - active = 0; - else - active = 1; - - if (*parv[2] == '+' || *parv[2] == '-') - parv[2]++; /* step past mode indicator */ - - /* - * forward the message appropriately - */ - if (0 == ircd_strcmp(parv[1], "*")) { - /* - * global! - */ - sendto_serv_butone(cptr, - active ? "%s " TOK_GLINE " %s +%s %s :%s" : "%s " TOK_GLINE " %s -%s", - NumServ(sptr), parv[1], parv[2], parv[3], parv[4]); - } - else if (( -#if 1 - /* - * REMOVE THIS after all servers upgraded to 2.10.01 and - * Uworld uses a numeric too - */ - (strlen(parv[1]) != 1 && !(acptr = FindClient(parv[1])))) || - (strlen(parv[1]) == 1 && -#endif - !(acptr = FindNServer(parv[1])))) - return 0; /* no such server/user exists; forget it */ - else -#if 1 -/* - * REMOVE THIS after all servers upgraded to 2.10.01 and - * Uworld uses a numeric too - */ - if (IsServer(acptr) || !MyConnect(acptr)) -#endif - { - /* single destination */ - sendto_one(acptr, - active ? "%s " TOK_GLINE " %s +%s %s :%s" : "%s " TOK_GLINE " %s -%s", - NumServ(sptr), parv[1], parv[2], parv[3], parv[4]); - return 0; /* only the intended destination - should add this gline */ - } - - if (!(host = strchr(parv[2], '@'))) { - /* - * convert user@host no @'s; assume username is '*' - */ - user = "*"; - host = parv[2]; - } - else { - user = parv[2]; - *(host++) = '\0'; /* break up string at the '@' */ - } - ip_mask = check_if_ipmask(host); /* Store this boolean */ -#ifdef BADCHAN - if ('#' == *host || '&' == *host || '+' == *host) - gtype = 1; /* BAD CHANNEL GLINE */ -#endif - for (gline = (gtype) ? BadChanGlineList : GlobalGlineList, prev = 0; gline; - gline = gline->next) - { - if (0 == ircd_strcmp(gline->name, user) && - 0 == ircd_strcmp(gline->host, host)) - break; - prev = gline; - } - - if (!active && gline) - { - /* - * removing the gline, notify opers - */ - sendto_op_mask(SNO_GLINE, "%s removing %s for %s@%s", parv[0], - gtype ? "BADCHAN" : "GLINE", gline->name, gline->host); - -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT " %s removing %s for %s@%s\n", - TStime(), parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, - gline->host); -#endif /* GPATH */ - - free_gline(gline, prev); /* remove the gline */ - } - else if (active) - { /* must be adding a gline */ - expire = atoi(parv[3]) + TStime(); /* expire time? */ - if (gline && gline->expire < expire) - { /* new expire time? */ - /* yes, notify the opers */ - sendto_op_mask(SNO_GLINE, - "%s resetting expiration time on %s for %s@%s to " TIME_T_FMT, - parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, gline->host, - expire); -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT " %s resetting expiration time " - "on %s for %s@%s to " TIME_T_FMT "\n", - TStime(), parv[0], gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host, expire); -#endif /* GPATH */ - - gline->expire = expire; /* reset the expire time */ - } - else if (!gline) - { /* create gline */ - for (gline = (gtype) ? BadChanGlineList : GlobalGlineList; gline; gline = gline->next) - if (!mmatch(gline->name, user) && - (ip_mask ? GlineIsIpMask(gline) : !GlineIsIpMask(gline)) && - !mmatch(gline->host, host)) - return 0; /* found an existing G-line that matches */ - - /* add the line: */ - add_gline(sptr, ip_mask, host, parv[4], user, expire, 0); - } - } - } - } - else if (parc < 2 || *parv[1] == '\0') - { - /* Not enough args and a user; list glines */ - for (gline = GlobalGlineList; gline; gline = gline->next) - sendto_one(cptr, rpl_str(RPL_GLIST), me.name, parv[0], - gline->name, gline->host, gline->expire, gline->reason, - GlineIsActive(gline) ? (GlineIsLocal(gline) ? " (local)" : "") : - " (Inactive)"); - sendto_one(cptr, rpl_str(RPL_ENDOFGLIST), me.name, parv[0]); - } - else - { - int priv; - -#ifdef LOCOP_LGLINE - priv = IsAnOper(cptr); -#else - priv = IsOper(cptr); -#endif - - if (priv) - { /* non-oper not permitted to change things */ - if (*parv[1] == '-') - { /* oper wants to deactivate the gline */ - active = 0; - parv[1]++; - } - else if (*parv[1] == '+') - { /* oper wants to activate inactive gline */ - active = 1; - parv[1]++; - } - else - active = -1; - - if (parc > 2) - expire = atoi(parv[2]) + TStime(); /* oper wants to reset - expire TS */ - } - else - active = -1; - - if (!(host = strchr(parv[1], '@'))) - { - user = "*"; /* no @'s; assume username is '*' */ - host = parv[1]; - } - else - { - user = parv[1]; - *(host++) = '\0'; /* break up string at the '@' */ - } - ip_mask = check_if_ipmask(host); /* Store this boolean */ -#ifdef BADCHAN - if ('#' == *host || '&' == *host || '+' == *host) -#ifndef LOCAL_BADCHAN - return 0; -#else - gtype = 1; /* BAD CHANNEL */ -#endif -#endif - - for (gline = (gtype) ? BadChanGlineList : GlobalGlineList, prev = 0; gline; - gline = gline->next) - { - if (!mmatch(gline->name, user) && - (ip_mask ? GlineIsIpMask(gline) : !GlineIsIpMask(gline)) && - !mmatch(gline->host, host)) - break; - prev = gline; - } - - if (!gline) - { -#ifdef OPER_LGLINE - if (priv && active && expire > CurrentTime) - { - /* Add local G-line */ - if (parc < 4 || !strchr(parv[3], ' ')) - return need_more_params(sptr, "GLINE"); - - add_gline(sptr, ip_mask, host, parv[3], user, expire, 1); - } - else -#endif - sendto_one(cptr, err_str(ERR_NOSUCHGLINE), me.name, parv[0], user, - host); - - return 0; - } - - if (expire <= gline->expire) - expire = 0; - - if ((active == -1 || - (active ? GlineIsActive(gline) : !GlineIsActive(gline))) && - expire == 0) - { - /* oper wants a list of one gline only */ - sendto_one(cptr, rpl_str(RPL_GLIST), me.name, parv[0], gline->name, - gline->host, gline->expire, gline->reason, - GlineIsActive(gline) ? "" : " (Inactive)"); - sendto_one(cptr, rpl_str(RPL_ENDOFGLIST), me.name, parv[0]); - return 0; - } - - if (active != -1 && - (active ? !GlineIsActive(gline) : GlineIsActive(gline))) - { - if (active) /* reset activation on gline */ - SetActive(gline); -#ifdef OPER_LGLINE - else if (GlineIsLocal(gline)) - { - /* Remove local G-line */ - sendto_op_mask(SNO_GLINE, "%s removed local %s for %s@%s", - parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, gline->host); -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT - " %s!%s@%s removed local %s for %s@%s\n", - TStime(), parv[0], cptr->user->username, cptr->user->host, - gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host); -#endif /* GPATH */ - free_gline(gline, prev); /* remove the gline */ - return 0; - } -#endif - else - ClearActive(gline); - } - else - active = -1; /* for later sendto_ops and logging functions */ - - if (expire) - gline->expire = expire; /* reset expiration time */ - - /* inform the operators what's up */ - if (active != -1) - { /* changing the activation */ - sendto_op_mask(SNO_GLINE, !expire ? "%s %sactivating %s for %s@%s" : - "%s %sactivating %s for %s@%s and " - "resetting expiration time to " TIME_T_FMT, - parv[0], active ? "re" : "de", gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host, gline->expire); -#ifdef GPATH - write_log(GPATH, !expire ? "# " TIME_T_FMT " %s!%s@%s %sactivating " - "%s for %s@%s\n" : "# " TIME_T_FMT " %s!%s@%s %sactivating %s " - "for %s@%s and resetting expiration time to " TIME_T_FMT "\n", - TStime(), parv[0], cptr->user->username, cptr->user->host, - active ? "re" : "de", gtype ? "BADCHAN" : "GLINE", gline->name, - gline->host, gline->expire); -#endif /* GPATH */ - - } - else if (expire) - { /* changing only the expiration */ - sendto_op_mask(SNO_GLINE, - "%s resetting expiration time on %s for %s@%s to " TIME_T_FMT, - parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, gline->host, - gline->expire); -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT " %s!%s@%s resetting expiration " - "time on %s for %s@%s to " TIME_T_FMT "\n", TStime(), parv[0], - cptr->user->username, cptr->user->host, gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host, gline->expire); -#endif /* GPATH */ - } - } - return 0; -} - -/* - * mo_gline - oper message handler - * - * parv[0] = Send prefix - * - * From server: - * - * parv[1] = Target: server numeric - * parv[2] = [+|-] - * parv[3] = Expiration offset - * parv[4] = Comment - * - * From client: - * - * parv[1] = [+|-] - * parv[2] = Expiration offset - * parv[3] = Comment - * - */ -int mo_gline(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) -{ - struct Client* acptr = 0; /* Init. to avoid compiler warning. */ - struct Gline* gline; - struct Gline* prev; - char* user; - char* host; - int active; - int ip_mask; - int gtype = 0; - time_t expire = 0; - - /* - * Remove expired G-lines - */ - gline_remove_expired(TStime()); -#ifdef BADCHAN - /* - * Remove expired bad channels - */ - bad_channel_remove_expired(TStime()); -#endif - - if (IsServer(cptr)) { - if (find_conf_byhost(cptr->confs, sptr->name, CONF_UWORLD)) { - if (parc < 3 || (*parv[2] != '-' && (parc < 5 || *parv[4] == '\0'))) - return need_more_params(sptr, "GLINE"); - - if (*parv[2] == '-') /* add mode or delete mode? */ - active = 0; - else - active = 1; - - if (*parv[2] == '+' || *parv[2] == '-') - parv[2]++; /* step past mode indicator */ - - /* - * forward the message appropriately - */ - if (0 == ircd_strcmp(parv[1], "*")) { - /* - * global! - */ - sendto_serv_butone(cptr, - active ? "%s " TOK_GLINE " %s +%s %s :%s" : "%s " TOK_GLINE " %s -%s", - NumServ(sptr), parv[1], parv[2], parv[3], parv[4]); - } - else if (( -#if 1 - /* - * REMOVE THIS after all servers upgraded to 2.10.01 and - * Uworld uses a numeric too - */ - (strlen(parv[1]) != 1 && !(acptr = FindClient(parv[1])))) || - (strlen(parv[1]) == 1 && -#endif - !(acptr = FindNServer(parv[1])))) - return 0; /* no such server/user exists; forget it */ - else -#if 1 -/* - * REMOVE THIS after all servers upgraded to 2.10.01 and - * Uworld uses a numeric too - */ - if (IsServer(acptr) || !MyConnect(acptr)) -#endif - { - /* single destination */ - sendto_one(acptr, - active ? "%s " TOK_GLINE " %s +%s %s :%s" : "%s " TOK_GLINE " %s -%s", - NumServ(sptr), parv[1], parv[2], parv[3], parv[4]); - return 0; /* only the intended destination - should add this gline */ - } - - if (!(host = strchr(parv[2], '@'))) { - /* - * convert user@host no @'s; assume username is '*' - */ - user = "*"; - host = parv[2]; - } - else { - user = parv[2]; - *(host++) = '\0'; /* break up string at the '@' */ - } - ip_mask = check_if_ipmask(host); /* Store this boolean */ -#ifdef BADCHAN - if ('#' == *host || '&' == *host || '+' == *host) - gtype = 1; /* BAD CHANNEL GLINE */ -#endif - for (gline = (gtype) ? BadChanGlineList : GlobalGlineList, prev = 0; gline; - gline = gline->next) - { - if (0 == ircd_strcmp(gline->name, user) && - 0 == ircd_strcmp(gline->host, host)) - break; - prev = gline; - } - - if (!active && gline) - { - /* - * removing the gline, notify opers - */ - sendto_op_mask(SNO_GLINE, "%s removing %s for %s@%s", parv[0], - gtype ? "BADCHAN" : "GLINE", gline->name, gline->host); - -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT " %s removing %s for %s@%s\n", - TStime(), parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, - gline->host); -#endif /* GPATH */ - - free_gline(gline, prev); /* remove the gline */ - } - else if (active) - { /* must be adding a gline */ - expire = atoi(parv[3]) + TStime(); /* expire time? */ - if (gline && gline->expire < expire) - { /* new expire time? */ - /* yes, notify the opers */ - sendto_op_mask(SNO_GLINE, - "%s resetting expiration time on %s for %s@%s to " TIME_T_FMT, - parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, gline->host, - expire); -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT " %s resetting expiration time " - "on %s for %s@%s to " TIME_T_FMT "\n", - TStime(), parv[0], gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host, expire); -#endif /* GPATH */ - - gline->expire = expire; /* reset the expire time */ - } - else if (!gline) - { /* create gline */ - for (gline = (gtype) ? BadChanGlineList : GlobalGlineList; gline; gline = gline->next) - if (!mmatch(gline->name, user) && - (ip_mask ? GlineIsIpMask(gline) : !GlineIsIpMask(gline)) && - !mmatch(gline->host, host)) - return 0; /* found an existing G-line that matches */ - - /* add the line: */ - add_gline(sptr, ip_mask, host, parv[4], user, expire, 0); - } - } - } - } - else if (parc < 2 || *parv[1] == '\0') - { - /* Not enough args and a user; list glines */ - for (gline = GlobalGlineList; gline; gline = gline->next) - sendto_one(cptr, rpl_str(RPL_GLIST), me.name, parv[0], - gline->name, gline->host, gline->expire, gline->reason, - GlineIsActive(gline) ? (GlineIsLocal(gline) ? " (local)" : "") : - " (Inactive)"); - sendto_one(cptr, rpl_str(RPL_ENDOFGLIST), me.name, parv[0]); - } - else - { - int priv; - -#ifdef LOCOP_LGLINE - priv = IsAnOper(cptr); -#else - priv = IsOper(cptr); -#endif - - if (priv) - { /* non-oper not permitted to change things */ - if (*parv[1] == '-') - { /* oper wants to deactivate the gline */ - active = 0; - parv[1]++; - } - else if (*parv[1] == '+') - { /* oper wants to activate inactive gline */ - active = 1; - parv[1]++; - } - else - active = -1; - - if (parc > 2) - expire = atoi(parv[2]) + TStime(); /* oper wants to reset - expire TS */ - } - else - active = -1; - - if (!(host = strchr(parv[1], '@'))) - { - user = "*"; /* no @'s; assume username is '*' */ - host = parv[1]; - } - else - { - user = parv[1]; - *(host++) = '\0'; /* break up string at the '@' */ - } - ip_mask = check_if_ipmask(host); /* Store this boolean */ -#ifdef BADCHAN - if ('#' == *host || '&' == *host || '+' == *host) -#ifndef LOCAL_BADCHAN - return 0; -#else - gtype = 1; /* BAD CHANNEL */ -#endif -#endif - - for (gline = (gtype) ? BadChanGlineList : GlobalGlineList, prev = 0; gline; - gline = gline->next) - { - if (!mmatch(gline->name, user) && - (ip_mask ? GlineIsIpMask(gline) : !GlineIsIpMask(gline)) && - !mmatch(gline->host, host)) - break; - prev = gline; - } - - if (!gline) - { -#ifdef OPER_LGLINE - if (priv && active && expire > CurrentTime) - { - /* Add local G-line */ - if (parc < 4 || !strchr(parv[3], ' ')) - return need_more_params(sptr, "GLINE"); - - add_gline(sptr, ip_mask, host, parv[3], user, expire, 1); - } - else -#endif - sendto_one(cptr, err_str(ERR_NOSUCHGLINE), me.name, parv[0], user, - host); - - return 0; - } - - if (expire <= gline->expire) - expire = 0; - - if ((active == -1 || - (active ? GlineIsActive(gline) : !GlineIsActive(gline))) && - expire == 0) - { - /* oper wants a list of one gline only */ - sendto_one(cptr, rpl_str(RPL_GLIST), me.name, parv[0], gline->name, - gline->host, gline->expire, gline->reason, - GlineIsActive(gline) ? "" : " (Inactive)"); - sendto_one(cptr, rpl_str(RPL_ENDOFGLIST), me.name, parv[0]); - return 0; - } - - if (active != -1 && - (active ? !GlineIsActive(gline) : GlineIsActive(gline))) - { - if (active) /* reset activation on gline */ - SetActive(gline); -#ifdef OPER_LGLINE - else if (GlineIsLocal(gline)) - { - /* Remove local G-line */ - sendto_op_mask(SNO_GLINE, "%s removed local %s for %s@%s", - parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, gline->host); -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT - " %s!%s@%s removed local %s for %s@%s\n", - TStime(), parv[0], cptr->user->username, cptr->user->host, - gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host); -#endif /* GPATH */ - free_gline(gline, prev); /* remove the gline */ - return 0; - } -#endif - else - ClearActive(gline); - } - else - active = -1; /* for later sendto_ops and logging functions */ - - if (expire) - gline->expire = expire; /* reset expiration time */ - - /* inform the operators what's up */ - if (active != -1) - { /* changing the activation */ - sendto_op_mask(SNO_GLINE, !expire ? "%s %sactivating %s for %s@%s" : - "%s %sactivating %s for %s@%s and " - "resetting expiration time to " TIME_T_FMT, - parv[0], active ? "re" : "de", gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host, gline->expire); -#ifdef GPATH - write_log(GPATH, !expire ? "# " TIME_T_FMT " %s!%s@%s %sactivating " - "%s for %s@%s\n" : "# " TIME_T_FMT " %s!%s@%s %sactivating %s " - "for %s@%s and resetting expiration time to " TIME_T_FMT "\n", - TStime(), parv[0], cptr->user->username, cptr->user->host, - active ? "re" : "de", gtype ? "BADCHAN" : "GLINE", gline->name, - gline->host, gline->expire); -#endif /* GPATH */ - - } - else if (expire) - { /* changing only the expiration */ - sendto_op_mask(SNO_GLINE, - "%s resetting expiration time on %s for %s@%s to " TIME_T_FMT, - parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, gline->host, - gline->expire); -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT " %s!%s@%s resetting expiration " - "time on %s for %s@%s to " TIME_T_FMT "\n", TStime(), parv[0], - cptr->user->username, cptr->user->host, gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host, gline->expire); -#endif /* GPATH */ - } - } - return 0; -} - - -#if 0 -/* - * m_gline - * - * parv[0] = Send prefix - * - * From server: - * - * parv[1] = Target: server numeric - * parv[2] = [+|-] - * parv[3] = Expiration offset - * parv[4] = Comment - * - * From client: - * - * parv[1] = [+|-] - * parv[2] = Expiration offset - * parv[3] = Comment - * - */ -int m_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) -{ - struct Client* acptr = 0; /* Init. to avoid compiler warning. */ - struct Gline* gline; - struct Gline* prev; - char* user; - char* host; - int active; - int ip_mask; - int gtype = 0; - time_t expire = 0; - - /* - * Remove expired G-lines - */ - gline_remove_expired(TStime()); -#ifdef BADCHAN - /* - * Remove expired bad channels - */ - bad_channel_remove_expired(TStime()); -#endif - - if (IsServer(cptr)) { - if (find_conf_byhost(cptr->confs, sptr->name, CONF_UWORLD)) { - if (parc < 3 || (*parv[2] != '-' && (parc < 5 || *parv[4] == '\0'))) - return need_more_params(sptr, "GLINE"); - - if (*parv[2] == '-') /* add mode or delete mode? */ - active = 0; - else - active = 1; - - if (*parv[2] == '+' || *parv[2] == '-') - parv[2]++; /* step past mode indicator */ - - /* - * forward the message appropriately - */ - if (0 == ircd_strcmp(parv[1], "*")) { - /* - * global! - */ - sendto_serv_butone(cptr, - active ? "%s " TOK_GLINE " %s +%s %s :%s" : "%s " TOK_GLINE " %s -%s", - NumServ(cptr), parv[1], parv[2], parv[3], parv[4]); - } - else if (( -#if 1 - /* - * REMOVE THIS after all servers upgraded to 2.10.01 and - * Uworld uses a numeric too - */ - (strlen(parv[1]) != 1 && !(acptr = FindClient(parv[1])))) || - (strlen(parv[1]) == 1 && -#endif - !(acptr = FindNServer(parv[1])))) - return 0; /* no such server/user exists; forget it */ - else -#if 1 -/* - * REMOVE THIS after all servers upgraded to 2.10.01 and - * Uworld uses a numeric too - */ - if (IsServer(acptr) || !MyConnect(acptr)) -#endif - { - /* single destination */ - sendto_one(acptr, - active ? "%s " TOK_GLINE " %s +%s %s :%s" : "%s " TOK_GLINE " %s -%s", - NumServ(sptr), parv[1], parv[2], parv[3], parv[4]); - return 0; /* only the intended destination - should add this gline */ - } - - if (!(host = strchr(parv[2], '@'))) { - /* - * convert user@host no @'s; assume username is '*' - */ - user = "*"; - host = parv[2]; - } - else { - user = parv[2]; - *(host++) = '\0'; /* break up string at the '@' */ - } - ip_mask = check_if_ipmask(host); /* Store this boolean */ -#ifdef BADCHAN - if ('#' == *host || '&' == *host || '+' == *host) - gtype = 1; /* BAD CHANNEL GLINE */ -#endif - for (gline = (gtype) ? BadChanGlineList : GlobalGlineList, prev = 0; gline; - gline = gline->next) - { - if (0 == ircd_strcmp(gline->name, user) && - 0 == ircd_strcmp(gline->host, host)) - break; - prev = gline; - } - - if (!active && gline) - { - /* - * removing the gline, notify opers - */ - sendto_op_mask(SNO_GLINE, "%s removing %s for %s@%s", parv[0], - gtype ? "BADCHAN" : "GLINE", gline->name, gline->host); - -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT " %s removing %s for %s@%s\n", - TStime(), parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, - gline->host); -#endif /* GPATH */ - - free_gline(gline, prev); /* remove the gline */ - } - else if (active) - { /* must be adding a gline */ - expire = atoi(parv[3]) + TStime(); /* expire time? */ - if (gline && gline->expire < expire) - { /* new expire time? */ - /* yes, notify the opers */ - sendto_op_mask(SNO_GLINE, - "%s resetting expiration time on %s for %s@%s to " TIME_T_FMT, - parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, gline->host, - expire); -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT " %s resetting expiration time " - "on %s for %s@%s to " TIME_T_FMT "\n", - TStime(), parv[0], gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host, expire); -#endif /* GPATH */ - - gline->expire = expire; /* reset the expire time */ - } - else if (!gline) - { /* create gline */ - for (gline = (gtype) ? BadChanGlineList : GlobalGlineList; gline; gline = gline->next) - if (!mmatch(gline->name, user) && - (ip_mask ? GlineIsIpMask(gline) : !GlineIsIpMask(gline)) && - !mmatch(gline->host, host)) - return 0; /* found an existing G-line that matches */ - - /* add the line: */ - add_gline(sptr, ip_mask, host, parv[4], user, expire, 0); - } - } - } - } - else if (parc < 2 || *parv[1] == '\0') - { - /* Not enough args and a user; list glines */ - for (gline = GlobalGlineList; gline; gline = gline->next) - sendto_one(cptr, rpl_str(RPL_GLIST), me.name, parv[0], - gline->name, gline->host, gline->expire, gline->reason, - GlineIsActive(gline) ? (GlineIsLocal(gline) ? " (local)" : "") : - " (Inactive)"); - sendto_one(cptr, rpl_str(RPL_ENDOFGLIST), me.name, parv[0]); - } - else - { - int priv; - -#ifdef LOCOP_LGLINE - priv = IsAnOper(cptr); -#else - priv = IsOper(cptr); -#endif - - if (priv) - { /* non-oper not permitted to change things */ - if (*parv[1] == '-') - { /* oper wants to deactivate the gline */ - active = 0; - parv[1]++; - } - else if (*parv[1] == '+') - { /* oper wants to activate inactive gline */ - active = 1; - parv[1]++; - } - else - active = -1; - - if (parc > 2) - expire = atoi(parv[2]) + TStime(); /* oper wants to reset - expire TS */ - } - else - active = -1; - - if (!(host = strchr(parv[1], '@'))) - { - user = "*"; /* no @'s; assume username is '*' */ - host = parv[1]; - } - else - { - user = parv[1]; - *(host++) = '\0'; /* break up string at the '@' */ - } - ip_mask = check_if_ipmask(host); /* Store this boolean */ -#ifdef BADCHAN - if ('#' == *host || '&' == *host || '+' == *host) -#ifndef LOCAL_BADCHAN - return 0; -#else - gtype = 1; /* BAD CHANNEL */ -#endif -#endif - - for (gline = (gtype) ? BadChanGlineList : GlobalGlineList, prev = 0; gline; - gline = gline->next) - { - if (!mmatch(gline->name, user) && - (ip_mask ? GlineIsIpMask(gline) : !GlineIsIpMask(gline)) && - !mmatch(gline->host, host)) - break; - prev = gline; - } - - if (!gline) - { -#ifdef OPER_LGLINE - if (priv && active && expire > CurrentTime) - { - /* Add local G-line */ - if (parc < 4 || !strchr(parv[3], ' ')) - return need_more_params(sptr, "GLINE"); - - add_gline(sptr, ip_mask, host, parv[3], user, expire, 1); - } - else -#endif - sendto_one(cptr, err_str(ERR_NOSUCHGLINE), me.name, parv[0], user, - host); - - return 0; - } - - if (expire <= gline->expire) - expire = 0; - - if ((active == -1 || - (active ? GlineIsActive(gline) : !GlineIsActive(gline))) && - expire == 0) - { - /* oper wants a list of one gline only */ - sendto_one(cptr, rpl_str(RPL_GLIST), me.name, parv[0], gline->name, - gline->host, gline->expire, gline->reason, - GlineIsActive(gline) ? "" : " (Inactive)"); - sendto_one(cptr, rpl_str(RPL_ENDOFGLIST), me.name, parv[0]); - return 0; - } - - if (active != -1 && - (active ? !GlineIsActive(gline) : GlineIsActive(gline))) - { - if (active) /* reset activation on gline */ - SetActive(gline); -#ifdef OPER_LGLINE - else if (GlineIsLocal(gline)) - { - /* Remove local G-line */ - sendto_op_mask(SNO_GLINE, "%s removed local %s for %s@%s", - parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, gline->host); -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT - " %s!%s@%s removed local %s for %s@%s\n", - TStime(), parv[0], cptr->user->username, cptr->user->host, - gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host); -#endif /* GPATH */ - free_gline(gline, prev); /* remove the gline */ - return 0; - } -#endif - else - ClearActive(gline); - } - else - active = -1; /* for later sendto_ops and logging functions */ - - if (expire) - gline->expire = expire; /* reset expiration time */ - - /* inform the operators what's up */ - if (active != -1) - { /* changing the activation */ - sendto_op_mask(SNO_GLINE, !expire ? "%s %sactivating %s for %s@%s" : - "%s %sactivating %s for %s@%s and " - "resetting expiration time to " TIME_T_FMT, - parv[0], active ? "re" : "de", gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host, gline->expire); -#ifdef GPATH - write_log(GPATH, !expire ? "# " TIME_T_FMT " %s!%s@%s %sactivating " - "%s for %s@%s\n" : "# " TIME_T_FMT " %s!%s@%s %sactivating %s " - "for %s@%s and resetting expiration time to " TIME_T_FMT "\n", - TStime(), parv[0], cptr->user->username, cptr->user->host, - active ? "re" : "de", gtype ? "BADCHAN" : "GLINE", gline->name, - gline->host, gline->expire); -#endif /* GPATH */ - - } - else if (expire) - { /* changing only the expiration */ - sendto_op_mask(SNO_GLINE, - "%s resetting expiration time on %s for %s@%s to " TIME_T_FMT, - parv[0], gtype ? "BADCHAN" : "GLINE", gline->name, gline->host, - gline->expire); -#ifdef GPATH - write_log(GPATH, "# " TIME_T_FMT " %s!%s@%s resetting expiration " - "time on %s for %s@%s to " TIME_T_FMT "\n", TStime(), parv[0], - cptr->user->username, cptr->user->host, gtype ? "BADCHAN" : "GLINE", - gline->name, gline->host, gline->expire); -#endif /* GPATH */ - } - } - return 0; -} - -#endif /* 0 */ - -#endif /* 0 */ diff --git a/ircd/m_jupe.c b/ircd/m_jupe.c index 24cb878..6541d04 100644 --- a/ircd/m_jupe.c +++ b/ircd/m_jupe.c @@ -194,6 +194,7 @@ int ms_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) * parv[4] = [Comment] * */ +#ifdef CONFIG_OPERCMDS int mo_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { struct Client *acptr = 0; @@ -259,6 +260,7 @@ int mo_jupe(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) return jupe_add(cptr, sptr, server, reason, expire_off, TStime(), local, active); } +#endif /* CONFIG_OPERCMDS */ /* * m_jupe - user message handler diff --git a/ircd/m_opmode.c b/ircd/m_opmode.c index 9bb4608..c67eb02 100644 --- a/ircd/m_opmode.c +++ b/ircd/m_opmode.c @@ -140,6 +140,9 @@ int ms_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) */ int mo_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { +#ifndef CONFIG_OPERCMDS + return send_error_to_client(sptr, ERR_DISABLED, "OPMODE"); +#else struct Channel *chptr = 0; struct ModeBuf mbuf; struct Membership *member; @@ -169,5 +172,6 @@ int mo_opmode(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) modebuf_flush(&mbuf); /* flush the modes */ return 0; +#endif /* CONFIG_OPERCMDS */ } diff --git a/ircd/parse.c b/ircd/parse.c index 64e9d0f..fcf819d 100644 --- a/ircd/parse.c +++ b/ircd/parse.c @@ -444,7 +444,11 @@ struct Message msgtab[] = { TOK_JUPE, 0, MAXPARA, MFLG_SLOW, 0, /* UNREG, CLIENT, SERVER, OPER, SERVICE */ +#ifdef CONFIG_OPERCMDS { m_unregistered, m_jupe, ms_jupe, mo_jupe, m_ignore } +#else + { m_unregistered, m_jupe, ms_jupe, m_jupe, m_ignore } +#endif /* CONFIG_OPERCMDS */ }, { MSG_OPMODE, diff --git a/ircd/s_err.c b/ircd/s_err.c index 416af23..32fcee0 100644 --- a/ircd/s_err.c +++ b/ircd/s_err.c @@ -1072,7 +1072,7 @@ static Numeric replyTable[] = { /* 516 */ { ERR_DONTCHEAT, " :Don't Cheat.", "516" }, /* 517 */ - { 0 }, + { ERR_DISABLED, "%s :Command disabled.", "517" }, /* 518 */ { 0 }, /* 519 */ -- 2.20.1