From 0a448eb4337cd92f8eeb21d9560506eb384ad69d Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Fri, 14 Dec 2007 02:37:48 +0000 Subject: [PATCH] Author: Kev Log message: Correct the issue where a 0 expiration time on a new G-line causes funny behavior. Instead, for server-issued G-lines, try hard by propagating a G-line activation/deactivation for G-lines we know nothing about, instead of calling gline_add(). Also, the make_gline() function now asserts that expire != 0. Note: it will not be necessary to release a .13 immediately. The REMGLINE issue can be easily worked around within euworld, and Isomer is making the appropriate changes. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/branches/u2_10_12_branch@1859 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- ChangeLog | 10 ++++++++++ ircd/gline.c | 2 ++ ircd/m_gline.c | 12 ++++++++++++ 3 files changed, 24 insertions(+) diff --git a/ChangeLog b/ChangeLog index c022d21..fe31642 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-12-13 Kevin L. Mitchell + + * ircd/m_gline.c (ms_gline): if we got an activate or deactivate + for a global G-line we never heard of, and we cannot create it + because no expire time was sent, manually propagate the G-line + instead of trying to call gline_add() + + * ircd/gline.c (make_gline): never allow a G-line to be created + with a 0 expire time + 2007-12-03 Michael Poole * include/patchlevel.h (PATCHLEVEL): Bump for u2.10.12.12 release. diff --git a/ircd/gline.c b/ircd/gline.c index fd63607..f294d99 100644 --- a/ircd/gline.c +++ b/ircd/gline.c @@ -142,6 +142,8 @@ make_gline(char *user, char *host, char *reason, time_t expire, time_t lastmod, { struct Gline *gline; + assert(0 != expire); + gline = (struct Gline *)MyMalloc(sizeof(struct Gline)); /* alloc memory */ assert(0 != gline); diff --git a/ircd/m_gline.c b/ircd/m_gline.c index cd930a9..95e2ac1 100644 --- a/ircd/m_gline.c +++ b/ircd/m_gline.c @@ -347,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)); } -- 2.20.1