? .hg
? .hgignore
? a
? aclocal.m4
? autom4te.cache
? b
? backtrace.txt
? bug-3919-comment.2010.07.16.txt
? cache
? configure.lineno
? ircd.log
? ircd.pid
? ircd.tune
? motd.txt
? patches
? robots.txt
? server.cert.pem
? server.key.pem
? server.req.pem
? smotd.txt
? tmp
? todo
? tre-0.8.0.tar.gz
? unreal-3329-deoper-remove-snomask.patch
? unrealircd.conf
? doc/AntiRandom
? extras/c-ares
? extras/c-ares-1.6.0.tar
? extras/c-ares-1.6.0.tar.gz
? extras/c-ares.tar
? extras/regexp
? extras/tre-0.7.5
? extras/tre-0.8.0.tar
? extras/tre-0.8.0.tar.gz
? extras/tre.tar
? src/modules/AntiRandom-1.1
? src/modules/AntiRandom.tar.gz
? src/modules/antirandom.c
? src/modules/m_dnsbl.c
? src/modules/m_soper.c
Index: src/umodes.c
===================================================================
RCS file: /cvs/unreal/src/Attic/umodes.c,v
retrieving revision 1.1.2.27.2.4
diff -u -B -r1.1.2.27.2.4 umodes.c
--- src/umodes.c	5 Jun 2005 00:58:35 -0000	1.1.2.27.2.4
+++ src/umodes.c	19 Aug 2010 03:38:04 -0000
@@ -484,12 +484,32 @@
 	return -1;
 }
 
-/* Simply non-perfect function to remove all oper-snomasks, 
+/**
+ * Simply non-perfect function to remove all oper-snomasks, 
  * it's at least better than manually doing a .. &= ~SNO_BLAH everywhere.
+ *
+ * Also unsets all snomasks and UMODE_SERVNOTICE if it would seem the
+ * user doesn't deserve to have snomask after being deopered. This is
+ * simpler, but hackier, than actually recording whether or not the
+ * user already had some snomasks set before OPERing and then reset
+ * his stuff to that... --binki
  */
 void remove_oper_snomasks(aClient *sptr)
 {
 int i;
+	/*
+	 * See #3329
+	 */
+	if (sptr->umodes & UMODE_SERVNOTICE
+	    && strchr(RESTRICT_USERMODES, 's')
+	    && !(CONN_MODES & UMODE_SERVNOTICE))
+	{
+		sptr->umodes &= ~UMODE_SERVNOTICE;
+		sptr->user->snomask = 0;
+		/* we unset all snomasks, so short-circuit */
+		return;
+	}
+
 	for (i = 0; i <= Snomask_highest; i++)
 	{
 		if (!Snomask_Table[i].flag)
