From: Kevin L. Mitchell Date: Thu, 4 May 2000 18:09:47 +0000 (+0000) Subject: Author: Kev X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=2eeb318eab68a5630ed0a7425039ad62a34b3ece Author: Kev Log message: 1) Don't propagate local changes to jupes and G-lines 2) Force oper-initiated changes of Uworld-set G-lines to be local only 3) Remove Uworld-set G-lines instead of simply deactivating them git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@236 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 194c3f8..c94168f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2000-05-04 Kevin L. Mitchell + * ircd/gline.c: don't propagate local changes + + * ircd/jupe.c: don't propagate local changes + + * ircd/m_gline.c (mo_gline): force local flag when deactivating + glines with 0 lastmod + + * ircd/gline.c (gline_deactivate): G-lines with zero lastmod time + are now removed instead of being deactivated + * ircd/m_gline.c (ms_gline): make G-lines of the form "GLINE * -" be accepted @@ -1122,7 +1132,7 @@ # # ChangeLog for ircu2.10.11 # -# $Id: ChangeLog,v 1.133 2000-05-04 17:43:47 kev Exp $ +# $Id: ChangeLog,v 1.134 2000-05-04 18:09:46 kev Exp $ # # Insert new changes at beginning of the change list. # diff --git a/ircd/gline.c b/ircd/gline.c index a79f5d8..50c8773 100644 --- a/ircd/gline.c +++ b/ircd/gline.c @@ -304,7 +304,8 @@ gline_activate(struct Client *cptr, struct Client *sptr, struct Gline *gline, gline->gl_expire + TSoffset, gline->gl_reason); #endif /* GPATH */ - propagate_gline(cptr, sptr, gline); + if (!(flags & GLINE_LOCAL)) /* don't propagate local changes */ + propagate_gline(cptr, sptr, gline); return GlineIsBadChan(gline) ? 0 : do_gline(cptr, sptr, gline); } @@ -314,12 +315,19 @@ gline_deactivate(struct Client *cptr, struct Client *sptr, struct Gline *gline, time_t lastmod, unsigned int flags) { unsigned int saveflags = 0; + char *msg; assert(0 != gline); saveflags = gline->gl_flags; - if (!GlineIsLocal(gline)) { + if (GlineIsLocal(gline)) + msg = "removing local"; + else if (!gline->gl_lastmod && !(flags & GLINE_LOCAL)) + msg = "removing global"; + else { + msg = "deactivating global"; + if (flags & GLINE_LOCAL) gline->gl_flags |= GLINE_LDEACT; else { @@ -339,26 +347,22 @@ gline_deactivate(struct Client *cptr, struct Client *sptr, struct Gline *gline, sendto_opmask_butone(0, SNO_GLINE, "%s %s %s for %s%s%s, expiring at %Tu: " "%s", IsServer(sptr) ? sptr->name : sptr->user->server->name, - GlineIsLocal(gline) ? "removing local" : - "deactivating global", - GlineIsBadChan(gline) ? "BADCHAN" : "GLINE", + msg, GlineIsBadChan(gline) ? "BADCHAN" : "GLINE", gline->gl_user, GlineIsBadChan(gline) ? "" : "@", GlineIsBadChan(gline) ? "" : gline->gl_host, gline->gl_expire + TSoffset, gline->gl_reason); #ifdef GPATH write_log(GPATH, "# %Tu %C %s %s for %s%s%s, expiring at %Tu: %s\n", - TStime(), sptr, - GlineIsLocal(gline) ? "removing local" : "deactivating global", - GlineIsBadChan(gline) ? "BADCHAN" : "GLINE", + TStime(), sptr, msg, GlineIsBadChan(gline) ? "BADCHAN" : "GLINE", gline->gl_user, GlineIsBadChan(gline) ? "" : "@", GlineIsBadChan(gline) ? "" : gline->gl_host, gline->gl_expire + TSoffset, gline->gl_reason); #endif /* GPATH */ - if (GlineIsLocal(gline)) + if (GlineIsLocal(gline) || (!gline->gl_lastmod && !(flags & GLINE_LOCAL))) gline_free(gline); - else + else if (!(flags & GLINE_LOCAL)) /* don't propagate local changes */ propagate_gline(cptr, sptr, gline); return 0; diff --git a/ircd/jupe.c b/ircd/jupe.c index 9c0f344..6fdcc64 100644 --- a/ircd/jupe.c +++ b/ircd/jupe.c @@ -175,7 +175,8 @@ jupe_activate(struct Client *cptr, struct Client *sptr, struct Jupe *jupe, jupe->ju_reason); #endif /* JPATH */ - propagate_jupe(cptr, sptr, jupe); + if (!(flags & JUPE_LOCAL)) /* don't propagate local changes */ + propagate_jupe(cptr, sptr, jupe); return do_jupe(cptr, sptr, jupe); } @@ -222,7 +223,7 @@ jupe_deactivate(struct Client *cptr, struct Client *sptr, struct Jupe *jupe, if (JupeIsLocal(jupe)) jupe_free(jupe); - else + else if (!(flags & JUPE_LOCAL)) /* don't propagate local changes */ propagate_jupe(cptr, sptr, jupe); return 0; diff --git a/ircd/m_gline.c b/ircd/m_gline.c index 6f5e3d3..cc5915a 100644 --- a/ircd/m_gline.c +++ b/ircd/m_gline.c @@ -283,6 +283,9 @@ mo_gline(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) if (GlineIsLocal(agline) && !(flags & GLINE_LOCAL)) /* global over local */ gline_free(agline); else { + if (!GlineLastMod(agline)) /* force mods to Uworld-set G-lines local */ + flags |= GLINE_LOCAL; + if (flags & GLINE_ACTIVE) return gline_activate(cptr, sptr, agline, GlineLastMod(agline) ? TStime() : 0, flags);