Revision: 1904
          
http://undernet-ircu.svn.sourceforge.net/undernet-ircu/?rev=1904&view=rev
Author:   entrope
Date:     2009-02-09 00:03:34 +0000 (Mon, 09 Feb 2009)

Log Message:
-----------
Author: Michael Poole <[email protected]>
Description:

Revert the part of the G-line parsing cleanup that does not create new
deactivated G-lines.  Instead, just explain that it is deactivated.

Modified Paths:
--------------
    ircu2/branches/u2_10_12_branch/ChangeLog
    ircu2/branches/u2_10_12_branch/include/gline.h
    ircu2/branches/u2_10_12_branch/ircd/gline.c
    ircu2/branches/u2_10_12_branch/ircd/m_gline.c
    ircu2/branches/u2_10_12_branch/tests/glines.cmd

Modified: ircu2/branches/u2_10_12_branch/ChangeLog
===================================================================
--- ircu2/branches/u2_10_12_branch/ChangeLog    2009-01-13 03:54:45 UTC (rev 
1903)
+++ ircu2/branches/u2_10_12_branch/ChangeLog    2009-02-09 00:03:34 UTC (rev 
1904)
@@ -1,3 +1,16 @@
+2009-02-08  Michael Poole <[email protected]>
+
+       * include/gline.h (gline_forward_deactivation): Undeclare.
+
+       * ircd/m_gline.c (mo_gline): Remove the special case to call
+       gline_forward_deactivation().
+
+       * ircd/gline.c (gline_add): Mention if the new G-line is already
+       deactivated.
+       (gline_forward_deactivation): Delete implementation.
+
+       * tests/glines.cmd: Update the expected output to match.
+
 2009-01-12  Michael Poole <[email protected]>
 
        * ircd/m_topic.c (do_settopic): Just before sending the topic out,

Modified: ircu2/branches/u2_10_12_branch/include/gline.h
===================================================================
--- ircu2/branches/u2_10_12_branch/include/gline.h      2009-01-13 03:54:45 UTC 
(rev 1903)
+++ ircu2/branches/u2_10_12_branch/include/gline.h      2009-02-09 00:03:34 UTC 
(rev 1904)
@@ -128,9 +128,6 @@
 extern int gline_deactivate(struct Client *cptr, struct Client *sptr,
                            struct Gline *gline, time_t lastmod,
                            unsigned int flags);
-extern int gline_forward_deactivation(struct Client *cptr, struct Client *sptr,
-                                      char *userhost, time_t expire, time_t 
lastmod,
-                                      time_t lifetime, unsigned int flags);
 extern int gline_modify(struct Client *cptr, struct Client *sptr,
                        struct Gline *gline, enum GlineAction action,
                        char *reason, time_t expire, time_t lastmod,

Modified: ircu2/branches/u2_10_12_branch/ircd/gline.c
===================================================================
--- ircu2/branches/u2_10_12_branch/ircd/gline.c 2009-01-13 03:54:45 UTC (rev 
1903)
+++ ircu2/branches/u2_10_12_branch/ircd/gline.c 2009-02-09 00:03:34 UTC (rev 
1904)
@@ -512,11 +512,12 @@
 
   /* Inform ops... */
   sendto_opmask_butone(0, ircd_strncmp(reason, "AUTO", 4) ? SNO_GLINE :
-                       SNO_AUTO, "%s adding %s %s for %s%s%s, expiring at "
+                       SNO_AUTO, "%s adding %s%s %s for %s%s%s, expiring at "
                        "%Tu: %s",
                        (feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
                          cli_name(sptr) :
                          cli_name((cli_user(sptr))->server),
+                       (flags & GLINE_ACTIVE) ? "" : "deactivated ",
                       (flags & GLINE_LOCAL) ? "local" : "global",
                       (flags & GLINE_BADCHAN) ? "BADCHAN" : "GLINE", user,
                       (flags & (GLINE_BADCHAN|GLINE_REALNAME)) ? "" : "@",
@@ -675,42 +676,6 @@
   return 0;
 }
 
-/** Send a deactivation request for a locally unknown G-line.
- * @param[in] cptr Client that sent us the G-line modification.
- * @param[in] sptr Client that originated the G-line modification.
- * @param[in] userhost Text representation of G-line target.
- * @param[in] expire Expiration time of G-line.
- * @param[in] lastmod Last modification time of G-line.
- * @param[in] lifetime Lifetime of G-line.
- * @param[in] flags Bitwise combination of GLINE_* flags.
- * @return Zero.
- */
-int
-gline_forward_deactivation(struct Client *cptr, struct Client *sptr,
-                           char *userhost, time_t expire, time_t lastmod,
-                           time_t lifetime, unsigned int flags)
-{
-  char *msg = "deactivating unknown global";
-
-  if (!lifetime)
-    lifetime = expire;
-
-  /* Inform ops and log it */
-  sendto_opmask_butone(0, SNO_GLINE, "%s %s GLINE for %s, expiring at %Tu",
-                       (feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
-                         cli_name(sptr) : cli_name((cli_user(sptr))->server),
-                      msg, userhost, expire + TSoffset);
-
-  log_write(LS_GLINE, L_INFO, LOG_NOSNOTICE,
-           "%#C %s GLINE for %s, expiring at %Tu", sptr, msg, userhost,
-           expire);
-
-  sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, "* -%s %Tu %Tu %Tu",
-                        userhost, expire, lastmod, lifetime);
-
-  return 0;
-}
-
 /** Modify a global G-line.
  * @param[in] cptr Client that sent us the G-line modification.
  * @param[in] sptr Client that originated the G-line modification.

Modified: ircu2/branches/u2_10_12_branch/ircd/m_gline.c
===================================================================
--- ircu2/branches/u2_10_12_branch/ircd/m_gline.c       2009-01-13 03:54:45 UTC 
(rev 1903)
+++ ircu2/branches/u2_10_12_branch/ircd/m_gline.c       2009-02-09 00:03:34 UTC 
(rev 1904)
@@ -610,12 +610,6 @@
       return send_reply(sptr, ERR_NOPRIVILEGES);
   }
 
-  /* If globally disabling a G-line that we do not already have, avoid
-   * creating a temporary one. */
-  if (!agline && action == GLINE_DEACTIVATE) {
-    return gline_forward_deactivation(cptr, sptr, mask, expire, CurrentTime, 
0, flags);
-  }
-
   Debug((DEBUG_DEBUG, "I have a global G-line I am acting upon now; "
         "target %s, mask %s, operforce %s, action %s, expire %Tu, "
         "reason: %s; gline %s!  (fields present: %s %s)", target, 

Modified: ircu2/branches/u2_10_12_branch/tests/glines.cmd
===================================================================
--- ircu2/branches/u2_10_12_branch/tests/glines.cmd     2009-01-13 03:54:45 UTC 
(rev 1903)
+++ ircu2/branches/u2_10_12_branch/tests/glines.cmd     2009-02-09 00:03:34 UTC 
(rev 1904)
@@ -203,8 +203,8 @@
 :cl1 expect %srv1-name% 515 \\* :Bad expire time
 :cl1 raw :GLINE [email protected] * 100000
 :cl1 expect %srv1-name% 515 \\* :Bad expire time
-:cl1 raw :GLINE [email protected] * 100000 :foo
-:cl1 expect %srv1-name% NOTICE :\\*\\*\\* Notice -- %cl1-nick% deactivating 
unknown global GLINE for [email protected]
+:cl1 raw :GLINE [email protected] * 100000 :foo
+:cl1 expect %srv1-name% NOTICE :\\*\\*\\* Notice -- %cl1-nick% adding 
deactivated global GLINE for [email protected]
 
 # Now start with the operations that create or need a global G-line.
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches

Reply via email to