+@@ -630,7 +631,8 @@
+ return 0; /* was active to begin with */
+
+ /* Inform ops and log it */
+- sendto_opmask_butone(0, SNO_GLINE, "%s activating global %s for %s%s%s%s%s, "
++ sendto_opmask_butone(0, GlineIsAuto(gline) ? SNO_AUTO : SNO_GLINE,
++ "%s activating global %s for %s%s%s%s%s, "
+ "expiring at %Tu: %s",
+ (feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
+ cli_name(sptr) :
+@@ -756,7 +758,8 @@
+ lifetime = expire;
+
+ /* Inform ops and log it */
+- sendto_opmask_butone(0, SNO_GLINE, "%s %s GLINE for %s, expiring at %Tu",
++ sendto_opmask_butone(0, (flags & GLINE_AUTO) ? SNO_AUTO : 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);
+@@ -765,7 +768,8 @@
+ "%#C %s GLINE for %s, expiring at %Tu", sptr, msg, userhost,
+ expire);
+
+- sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, "* -%s %Tu %Tu %Tu",
++ sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, "* %s-%s %Tu %Tu %Tu",
++ (flags & GLINE_AUTO) ? "=" : "",
+ userhost, expire, lastmod, lifetime);
+
+ return 0;
+@@ -912,6 +916,12 @@
+ break;
+ }
+
++ /* Handle the change of auto or manual G-line */
++ if ((flags & GLINE_AUTO) && !GlineIsAuto(gline))
++ gline->gl_flags |= GLINE_AUTO; /* mark as auto */
++ else if (!(flags & GLINE_AUTO) && GlineIsAuto(gline))
++ gline->gl_flags &= ~GLINE_AUTO; /* mark as manual */
++
+ /* Handle expiration changes... */
+ if (flags & GLINE_EXPIRE) {
+ gline->gl_expire = expire; /* save new expiration time */
+@@ -944,7 +954,8 @@
+ }
+
+ /* All right, inform ops... */
+- sendto_opmask_butone(0, SNO_GLINE, "%s modifying global %s for %s%s%s%s%s:%s",
++ sendto_opmask_butone(0, flags & GLINE_AUTO ? SNO_GLINE : SNO_GLINE,
++ "%s modifying global %s for %s%s%s%s%s:%s",
+ (feature_bool(FEAT_HIS_SNOTICES) || IsServer(sptr)) ?
+ cli_name(sptr) : cli_name((cli_user(sptr))->server),
+ GlineIsBadChan(gline) ? "BADCHAN" : "GLINE",
+@@ -965,7 +976,8 @@
+ */
+ if (action != GLINE_LOCAL_ACTIVATE && action != GLINE_LOCAL_DEACTIVATE)
+ sendcmdto_serv_butone(sptr, CMD_GLINE, cptr,
+- "* %s%s%s%s%s%s%s %Tu %Tu %Tu :%s",
++ "* %s%s%s%s%s%s%s%s %Tu %Tu %Tu :%s",
++ (flags & GLINE_AUTO) ? "=" : "",
+ flags & GLINE_OPERFORCE ? "!" : "", op,
+ GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : gline->gl_nick,
+ GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : "!",
+@@ -1179,8 +1191,9 @@
+
+ gliter(GlobalGlineList, gline, sgline) {
+ if (!GlineIsLocal(gline) && gline->gl_lastmod)
+- sendcmdto_one(&me, CMD_GLINE, cptr, "* %c%s%s%s%s%s %Tu %Tu %Tu :%s",
+- GlineIsRemActive(gline) ? '+' : '-',
++ sendcmdto_one(&me, CMD_GLINE, cptr, "* %s%c%s%s%s%s%s %Tu %Tu %Tu :%s",
++ GlineIsAuto(gline) ? "=" : "",
++ GlineIsRemActive(gline) ? '+' : '-',
+ gline->gl_nick ? gline->gl_nick : "",
+ gline->gl_nick ? "!" : "",
+ gline->gl_user,
+@@ -1192,7 +1205,8 @@
+
+ gliter(BadChanGlineList, gline, sgline) {
+ if (!GlineIsLocal(gline) && gline->gl_lastmod)
+- sendcmdto_one(&me, CMD_GLINE, cptr, "* %c%s %Tu %Tu %Tu :%s",
++ sendcmdto_one(&me, CMD_GLINE, cptr, "* %s%c%s %Tu %Tu %Tu :%s",
++ GlineIsAuto(gline) ? "=" : "",
+ GlineIsRemActive(gline) ? '+' : '-', gline->gl_user,
+ gline->gl_expire - CurrentTime, gline->gl_lastmod,
+ gline->gl_lifetime, gline->gl_reason);
+@@ -1210,7 +1224,8 @@
+ if (GlineIsLocal(gline) || !gline->gl_lastmod)
+ return 0;
+
+- sendcmdto_one(&me, CMD_GLINE, cptr, "* %c%s%s%s%s%s %Tu %Tu %Tu :%s",
++ sendcmdto_one(&me, CMD_GLINE, cptr, "* %s%c%s%s%s%s%s %Tu %Tu %Tu :%s",
++ GlineIsAuto(gline) ? "=" : "",
+ GlineIsRemActive(gline) ? '+' : '-',
+ GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : gline->gl_nick,
+ GlineIsBadChan(gline)|GlineIsRealName(gline) ? "" : "!",
+@@ -1249,6 +1264,7 @@
+ gline->gl_expire + TSoffset, gline->gl_lastmod,
+ gline->gl_lifetime + TSoffset,
+ GlineIsLocal(gline) ? cli_name(&me) : "*",
++ GlineIsAuto(gline) && IsAnOper(sptr) ? "=" : "",
+ gline->gl_state == GLOCAL_ACTIVATED ? ">" :
+ (gline->gl_state == GLOCAL_DEACTIVATED ? "<" : ""),
+ GlineIsRemActive(gline) ? '+' : '-', gline->gl_reason);
+@@ -1263,6 +1279,7 @@
+ gline->gl_expire + TSoffset, gline->gl_lastmod,
+ gline->gl_lifetime + TSoffset,
+ GlineIsLocal(gline) ? cli_name(&me) : "*",
++ GlineIsAuto(gline) && IsAnOper(sptr) ? "=" : "",
+ gline->gl_state == GLOCAL_ACTIVATED ? ">" :
+ (gline->gl_state == GLOCAL_DEACTIVATED ? "<" : ""),
+ GlineIsRemActive(gline) ? '+' : '-', gline->gl_reason);
+@@ -1273,6 +1290,7 @@
+ gline->gl_expire + TSoffset, gline->gl_lastmod,
+ gline->gl_lifetime + TSoffset,
+ GlineIsLocal(gline) ? cli_name(&me) : "*",
++ GlineIsAuto(gline) && IsAnOper(sptr) ? "=" : "",
+ gline->gl_state == GLOCAL_ACTIVATED ? ">" :
+ (gline->gl_state == GLOCAL_DEACTIVATED ? "<" : ""),
+ GlineIsRemActive(gline) ? '+' : '-', gline->gl_reason);
+@@ -1304,6 +1322,7 @@
+ gline->gl_host ? gline->gl_host : "",
+ gline->gl_expire + TSoffset, gline->gl_lastmod,
+ gline->gl_lifetime + TSoffset,
++ GlineIsAuto(gline) && IsAnOper(sptr) ? "=" : "",
+ gline->gl_state == GLOCAL_ACTIVATED ? ">" :
+ (gline->gl_state == GLOCAL_DEACTIVATED ? "<" : ""),
+ GlineIsRemActive(gline) ? '+' : '-',
+@@ -1314,6 +1333,7 @@
+ send_reply(sptr, RPL_STATSGLINE, 'G', gline->gl_user, "", "", "", "",
+ gline->gl_expire + TSoffset, gline->gl_lastmod,
+ gline->gl_lifetime + TSoffset,
++ GlineIsAuto(gline) && IsAnOper(sptr) ? "=" : "",
+ gline->gl_state == GLOCAL_ACTIVATED ? ">" :
+ (gline->gl_state == GLOCAL_DEACTIVATED ? "<" : ""),
+ GlineIsRemActive(gline) ? '+' : '-', gline->gl_reason);
+diff -r a4507a57b7cd ircd/m_gline.c
+--- a/ircd/m_gline.c Sun Jan 18 21:11:24 2009 +0100
++++ b/ircd/m_gline.c Sun Jan 18 23:19:35 2009 +0100
+@@ -140,6 +140,11 @@
+ if (IsServer(sptr))
+ flags |= GLINE_FORCE;
+
++ if (*mask == '=') {
++ mask++;
++ flags |= GLINE_AUTO; /* auto G-line action by service */
++ }
++
+ if (*mask == '!') {
+ mask++;
+ flags |= GLINE_OPERFORCE; /* assume oper had WIDE_GLINE */
+@@ -183,11 +188,14 @@
+ if ((action == GLINE_LOCAL_ACTIVATE || action == GLINE_LOCAL_DEACTIVATE) &&
+ !IsMe(acptr)) {
+ Debug((DEBUG_DEBUG, "I am forwarding a local change to a global gline "
+- "to a remote server; target %s, mask %s, operforce %s, action %c",
+- target, mask, flags & GLINE_OPERFORCE ? "YES" : "NO",
++ "to a remote server; target %s, mask %s, operforce %s, auto %s, action %c",
++ target, mask,
++ flags & GLINE_OPERFORCE ? "YES" : "NO",
++ flags & GLINE_AUTO ? "YES" : "NO",
+ action == GLINE_LOCAL_ACTIVATE ? '>' : '<'));
+
+- sendcmdto_one(sptr, CMD_GLINE, acptr, "%C %s%c%s", acptr,
++ sendcmdto_one(sptr, CMD_GLINE, acptr, "%C %s%s%c%s", acptr,
++ flags & GLINE_AUTO ? "=" : "",
+ flags & GLINE_OPERFORCE ? "!" : "",
+ action == GLINE_LOCAL_ACTIVATE ? '>' : '<', mask);
+
+@@ -226,8 +234,10 @@
+
+ /* OK, create the local G-line */
+ Debug((DEBUG_DEBUG, "I am creating a local G-line here; target %s, "
+- "mask %s, operforce %s, action %s, expire %Tu, reason: %s",
+- target, mask, flags & GLINE_OPERFORCE ? "YES" : "NO",
++ "mask %s, operforce %s, auto %s, action %s, expire %Tu, reason: %s",
++ target, mask,
++ flags & GLINE_OPERFORCE ? "YES" : "NO",
++ flags & GLINE_AUTO ? "YES" : "NO",
+ action == GLINE_ACTIVATE ? "+" : "-", expire, reason));
+
+ return gline_add(cptr, sptr, mask, reason, expire, lastmod,
+@@ -239,8 +249,9 @@
+
+ /* Let's now destroy the G-line */;
+ Debug((DEBUG_DEBUG, "I am destroying a local G-line here; target %s, "
+- "mask %s, operforce %s, action %s", target, mask,
++ "mask %s, operforce %s, auto %s, action %s", target, mask,
+ flags & GLINE_OPERFORCE ? "YES" : "NO",
++ flags & GLINE_AUTO ? "YES" : "NO",
+ action == GLINE_ACTIVATE ? "+" : "-"));
+
+ return gline_destroy(cptr, sptr, agline);
+@@ -255,14 +266,17 @@
+ assert(!IsMe(acptr));
+
+ Debug((DEBUG_DEBUG, "I am forwarding a local G-line to a remote server; "
+- "target %s, mask %s, operforce %s, action %c, expire %Tu, "
++ "target %s, mask %s, operforce %s, auto %s, action %c, expire %Tu, "
+ "lastmod %Tu, reason: %s", target, mask,
+ flags & GLINE_OPERFORCE ? "YES" : "NO",
++ flags & GLINE_AUTO ? "YES" : "NO",
+ action == GLINE_ACTIVATE ? '+' : '-', expire, CurrentTime,
+ reason));
+
+- sendcmdto_one(sptr, CMD_GLINE, acptr, "%C %s%c%s %Tu %Tu :%s",
+- acptr, flags & GLINE_OPERFORCE ? "!" : "",
++ sendcmdto_one(sptr, CMD_GLINE, acptr, "%C %s%s%c%s %Tu %Tu :%s",
++ acptr,
++ flags & GLINE_AUTO ? "=" : "",
++ flags & GLINE_OPERFORCE ? "!" : "",
+ action == GLINE_ACTIVATE ? '+' : '-', mask,
+ expire - CurrentTime, CurrentTime, reason);
+
+@@ -323,10 +337,11 @@
+ return need_more_params(sptr, "GLINE");
+
+ Debug((DEBUG_DEBUG, "I have a global G-line I am acting upon now; "
+- "target %s, mask %s, operforce %s, action %s, expire %Tu, "
++ "target %s, mask %s, operforce %s, auto %s, action %s, expire %Tu, "
+ "lastmod %Tu, lifetime %Tu, reason: %s; gline %s! (fields "
+ "present: %s %s %s)", target, mask,
+ flags & GLINE_OPERFORCE ? "YES" : "NO",
++ flags & GLINE_AUTO ? "YES" : "NO",
+ action == GLINE_ACTIVATE ? "+" :
+ (action == GLINE_DEACTIVATE ? "-" :
+ (action == GLINE_LOCAL_ACTIVATE ? ">" :
+@@ -353,7 +368,8 @@
+ 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",
++ sendcmdto_serv_butone(sptr, CMD_GLINE, cptr, "* %s%c%s %Tu",
++ flags & GLINE_AUTO ? "=" : "",
+ action == GLINE_ACTIVATE ? '+' : '-',
+ mask, lastmod);
+
+@@ -387,6 +403,10 @@
+ return send_reply(sptr, ERR_NOPRIVILEGES);
+ else
+ return gline_list(sptr, 0);
++ }
++
++ if (*mask == '=') { /* ignore auto prefix from oper */
++ mask++;
+ }
+
+ if (*mask == '!') {
+@@ -506,11 +526,14 @@
+ return send_reply(sptr, ERR_NOPRIVILEGES);
+
+ Debug((DEBUG_DEBUG, "I am forwarding a local change to a global gline "
+- "to a remote server; target %s, mask %s, operforce %s, action %c",
+- cli_name(acptr), mask, flags & GLINE_OPERFORCE ? "YES" : "NO",
++ "to a remote server; target %s, mask %s, operforce %s, auto %s, action %c",
++ cli_name(acptr), mask,
++ flags & GLINE_OPERFORCE ? "YES" : "NO",
++ flags & GLINE_AUTO ? "YES" : "NO",
+ action == GLINE_LOCAL_ACTIVATE ? '>' : '<'));
+
+ sendcmdto_one(sptr, CMD_GLINE, acptr, "%C %s%c%s", acptr,
++ flags & GLINE_AUTO ? "=" : "",
+ flags & GLINE_OPERFORCE ? "!" : "",
+ action == GLINE_LOCAL_ACTIVATE ? '>' : '<', mask);
+
+@@ -544,13 +567,16 @@
+ return send_reply(sptr, ERR_NOPRIVILEGES);
+
+ Debug((DEBUG_DEBUG, "I am forwarding a local G-line to a remote "
+- "server; target %s, mask %s, operforce %s, action %c, "
++ "server; target %s, mask %s, operforce %s, auto %s, action %c, "
+ "expire %Tu, reason %s", target, mask,
+ flags & GLINE_OPERFORCE ? "YES" : "NO",
++ flags & GLINE_AUTO ? "YES" : "NO",
+ action == GLINE_ACTIVATE ? '+' : '-', expire, reason));