]> jfr.im git - irc/quakenet/snircd-patchqueue.git/commitdiff
enforceinvisible: only disallow _local_ users setting usermode -i when feature AUTOIN...
authorwiebe <redacted>
Tue, 20 Apr 2010 12:43:07 +0000 (14:43 +0200)
committerwiebe <redacted>
Tue, 20 Apr 2010 12:43:07 +0000 (14:43 +0200)
enforceinvisible.patch [new file with mode: 0644]
series

diff --git a/enforceinvisible.patch b/enforceinvisible.patch
new file mode 100644 (file)
index 0000000..c1b1ed0
--- /dev/null
@@ -0,0 +1,29 @@
+only disallow _local_ users setting usermode -i when feature AUTOINVISIBLE is turned on
+and do not enforce this setting on remote users, leads to desynch
+
+diff -r 8bf7e9b238c1 ircd/s_user.c
+--- a/ircd/s_user.c
++++ b/ircd/s_user.c
+@@ -1328,8 +1328,7 @@
+         if (what == MODE_ADD)
+           SetInvisible(sptr);
+         else
+-          if (!feature_bool(FEAT_AUTOINVISIBLE) || IsOper(sptr)) /* Don't allow non-opers to -i if FEAT_AUTOINVISIBLE is set */
+-            ClearInvisible(sptr);
++          ClearInvisible(sptr);
+         break;
+       case 'd':
+         if (what == MODE_ADD)
+@@ -1447,6 +1446,12 @@
+     if (!FlagHas(&setflags, FLAG_PARANOID) && !(IsOper(sptr) && HasPriv(sptr, PRIV_PARANOID)))
+       ClearParanoid(sptr);
++    /* disallow ordinary users to do MODE -i when feature AUTOINVISIBLE is enabled */
++    if (FlagHas(&setflags, FLAG_INVISIBLE) && !IsInvisible(sptr) &&          /* MODE -i */
++        feature_bool(FEAT_AUTOINVISIBLE) &&                                  /* AUTOINVISIBLE is enabled */
++        !FlagHas(&setflags, FLAG_OPER) && !FlagHas(&setflags, FLAG_LOCOP))   /* (was) not opered */
++       SetInvisible(sptr);
++
+     /*
+      * only send wallops to opers
+      */
diff --git a/series b/series
index 4837aa8323c24cd71cd260673eb0d589bbe812fd..55bd602a97456db0be09b0e2c41c053fb90fcb30 100644 (file)
--- a/series
+++ b/series
@@ -7,6 +7,7 @@ cprivmsgerracconly.patch
 badchanzombie.patch
 badchanlocalkick.patch
 nserverflag.patch
+enforceinvisible.patch
 minoplevel.patch
 ischannelservice.patch
 invalidatebanssethost.patch