+2004-05-14 Kevin L Mitchell <klmitch@mit.edu>
+
+ [Original ChangeLog date: 2003-11-22 -MDP]
+
+ * ircd/m_nick.c (m_nick): truncate the nickname to the minimum of
+ the maximum allowed length (NICKLEN) or the allowed nickname
+ length specified as the NICKLEN feature
+
+ * ircd/ircd_features.c: declare NICKLEN and set its default value
+ to 9
+
+ * include/supported.h: add MAXNICKLEN to ISUPPORT and do a little
+ rearranging...
+
+ * include/ircd_features.h: add NICKLEN feature
+
+ * include/ircd_defs.h (NICKLEN): raise max NICKLEN to 15
+
+ * doc/readme.features: document new NICKLEN feature
+
+ * doc/example.conf: list new NICKLEN F-line
+
2004-05-14 Matthias Crauwels <ultimate_@wol.be>
- [Original ChangeLog date: 2003-06-08 -MP]
+ [Original ChangeLog date: 2003-06-08 -MDP]
* ircd/gline.c: fixed the counting bug in gline_memory_count
# "HIDDEN_IP"="127.0.0.1";
# "KILLCHASETIMELIMIT"="30";
# "MAXCHANNELSPERUSER"="10";
+# "NICKLEN" = "9";
# "AVBANLEN"="40";
# "MAXBANS"="30";
# "MAXSILES"="15";
* Default: "ftp://ftp.undernet.org/pub/irc/clients"
This defines a URL that users may visit to find compatible IRC clients.
+
+NICKLEN
+ * Type: integer
+ * Default: 9
+
+This is the allowed length of the nickname length. It may not be
+larger than the NICKLEN #define, and should usually be the same
+length. The real purpose of this feature is to permit easy increases
+in nickname length for a network.
* is a default that can easily be overridden in CFLAGS. Just add
* -DNICKLEN=15 to CFLAGS and save your config in .., and you can forget about
* it. Thanks for helping debug guys.
+ * See also F:NICKLEN in ircd.conf.
*/
#ifndef NICKLEN
-#define NICKLEN 9
+#define NICKLEN 15
#endif
/*
* USERLEN is the maximum length allowed of a user name including an optional
/* features that probably should not be touched */
FEAT_KILLCHASETIMELIMIT,
FEAT_MAXCHANNELSPERUSER,
+ FEAT_NICKLEN,
FEAT_AVBANLEN,
FEAT_MAXBANS,
FEAT_MAXSILES,
" MAXCHANNELS=%i" \
" MAXBANS=%i" \
" NICKLEN=%i" \
+ " MAXNICKLEN=%i" \
" TOPICLEN=%i" \
" AWAYLEN=%i" \
" KICKLEN=%i"
#define FEATURESVALUES1 feature_int(FEAT_MAXSILES), MAXMODEPARAMS, \
feature_int(FEAT_MAXCHANNELSPERUSER), \
- feature_int(FEAT_MAXBANS), NICKLEN, TOPICLEN, \
- AWAYLEN, TOPICLEN
+ feature_int(FEAT_MAXBANS), feature_int(FEAT_NICKLEN), \
+ NICKLEN, TOPICLEN, AWAYLEN, TOPICLEN
#define FEATURESVALUES2 feature_bool(FEAT_LOCAL_CHANNELS) ? "#&" : "#", "(ov)@+", "b,k,l,imnpstrD", "rfc1459", \
feature_str(FEAT_NETWORK)
/* features that probably should not be touched */
F_I(KILLCHASETIMELIMIT, 0, 30, 0),
F_I(MAXCHANNELSPERUSER, 0, 10, 0),
+ F_I(NICKLEN, 0, 9, 0),
F_I(AVBANLEN, 0, 40, 0),
F_I(MAXBANS, 0, 45, 0),
F_I(MAXSILES, 0, 15, 0),
#include "s_misc.h"
#include "s_user.h"
#include "send.h"
+#include "sys.h"
#include <assert.h>
#include <stdlib.h>
* garbage
*/
arg = parv[1];
- if (strlen(arg) > NICKLEN)
- arg[NICKLEN] = '\0';
+ if (strlen(arg) > IRCD_MIN(NICKLEN, feature_int(FEAT_NICKLEN)))
+ arg[IRCD_MIN(NICKLEN, feature_int(FEAT_NICKLEN))] = '\0';
if ((s = strchr(arg, '~')))
*s = '\0';
* creation) then reject it. If from a server and we reject it,
* and KILL it. -avalon 4/4/92
*/
- if (strlen(nick) != do_nick_name(nick))
+ if (!do_nick_name(nick) || strcmp(nick, parv[1]))
{
send_reply(sptr, ERR_ERRONEUSNICKNAME, parv[1]);