[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggestion for moderating nick changes.



Matus "fantomas" Uhlar wrote:
> 
> -> > Hmm...funny...I would have thought that since nickchanges are propagated
> -> > to all servers it would be of interest to limit this form of abuse. I fail
> -> > to see any reason for not leveraging some heavy penalties on this form of
> -> > abuse.  After all it does consume both bandwidth and server resources. ;)
> ->
> -> there is quite strong penalty. if banned user changes nick, he/she can not
> -> do anything for 15 secs
> 
> how long is this feature present ?

you'll find the patch from cvs attached

log message:

revision 1.43
date: 1998/04/15 18:29:25;  author: kalt;  state: Exp;  lines: +10 -2
Bquiet

>From RELEASE_LOG

980927  2.10.0
980218  2.9.5

so in short, since 2.10


Q
Index: s_user.c
===================================================================
RCS file: /usr/local/repository/irc/ircd/s_user.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- s_user.c	1998/04/03 14:34:47	1.42
+++ s_user.c	1998/04/15 18:29:25	1.43
@@ -22,7 +22,7 @@
  */
 
 #ifndef lint
-static  char rcsid[] = "@(#)$Id: s_user.c,v 1.42 1998/04/03 14:34:47 kalt Exp $";
+static  char rcsid[] = "@(#)$Id: s_user.c,v 1.43 1998/04/15 18:29:25 kalt Exp $";
 #endif
 
 #include "os.h"
@@ -617,6 +617,7 @@
 	aClient *acptr;
 	int	delayed = 0;
 	char	nick[NICKLEN+2], *s, *user, *host;
+	Link	*lp;
 
 	if (IsService(sptr))
    	    {
@@ -897,6 +898,10 @@
 					   err_str(ERR_RESTRICTED, nick));
 				return 2;
 			    }
+			/* is the user banned on any channel ? */
+			for (lp = sptr->user->channel; lp; lp = lp->next)
+				if (can_send(sptr, lp->value.chptr) ==MODE_BAN)
+					break;
 		}
 		/*
 		** Client just changing his/her nick. If he/she is
@@ -946,7 +951,10 @@
 	**  Finally set new nick name.
 	*/
 	(void)add_to_client_hash_table(nick, sptr);
-	return 3;
+	if (lp)
+		return 15;
+	else
+		return 3;
 }
 
 /*