X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fm_gline.c;h=95e2ac173b29471b0898194b303e27d3543f98e9;hb=0a448eb4337cd92f8eeb21d9560506eb384ad69d;hp=cf0f002b57983b519abe741b330a45d46e7129d7;hpb=ab92e415c2830825e90398a776313fb0a7ab1728;p=ircu2.10.12-pk.git diff --git a/ircd/m_gline.c b/ircd/m_gline.c index cf0f002..95e2ac1 100644 --- a/ircd/m_gline.c +++ b/ircd/m_gline.c @@ -292,9 +292,6 @@ ms_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) case GLINE_MODIFY: /* modifying a G-line */ /* convert expire and lastmod, look for lifetime and reason */ if (parc > 4) { /* protect against fall-through from 4-param form */ - if (parc < 5) - return need_more_params(sptr, "GLINE"); - expire = atoi(parv[3]); /* convert expiration and lastmod */ expire = abs_expire(expire); lastmod = atoi(parv[4]); @@ -350,6 +347,18 @@ ms_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) assert(action != GLINE_LOCAL_DEACTIVATE); assert(action != GLINE_MODIFY); + if (!expire) { /* Cannot *add* a G-line we don't have, but try hard */ + Debug((DEBUG_DEBUG, "Propagating G-line %s for G-line we don't have", + action == GLINE_ACTIVATE ? "activation" : "deactivation")); + + /* propagate the G-line, even though we don't have it */ + sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, "* %c%s %Tu", + action == GLINE_ACTIVATE ? '+' : '-', + mask, lastmod); + + return 0; + } + return gline_add(cptr, sptr, mask, reason, expire, lastmod, lifetime, flags | ((action == GLINE_ACTIVATE) ? GLINE_ACTIVE : 0)); } @@ -418,7 +427,7 @@ mo_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) flags |= GLINE_EXPIRE; /* remember that we got an expire time */ if (parc > 4) { /* also got a reason... */ - reason = parv[4]; + reason = parv[parc - 1]; flags |= GLINE_REASON; }