This adds a new ISUPPORT token, NICKLEN_USABLE which is strictly an informative value.
NICKLEN is always the maximum runtime NICKLEN supported by the IRCd, as other servers may
have their own usable NICKLEN settings. As NICKLEN_USABLE is strictly informative, and
NICKLEN is always the maximum possible NICKLEN, any clients which depend on NICKLEN for
memory preallocation will be unaffected by runtime changes to NICKLEN_USABLE.
The default NICKLEN is 50; the default serverinfo::nicklen in the config file is set to
30, which is the NICKLEN presently used on StaticBox.
Custom branding name.
--with-custom-version=NAME
Custom version branding.
- --with-nicklen=LENGTH Set the nick length to LENGTH (default 15, max 50)
+ --with-nicklen=LENGTH Set the upper-bound nick length to LENGTH (default
+ 50, max 50)
--with-topiclen=NUMBER Set the max topic length to NUMBER (default 390, max
390)
fi
else
- NICKLEN=15
+ NICKLEN=50
fi
fi
AC_ARG_WITH(nicklen,
-AC_HELP_STRING([--with-nicklen=LENGTH],[Set the nick length to LENGTH (default 15, max 50)]),
+AC_HELP_STRING([--with-nicklen=LENGTH],[Set the upper-bound nick length to LENGTH (default 50, max 50)]),
[
if ! expr "$withval" + 0 >/dev/null 2>&1; then
AC_ERROR([NICKLEN must be a numeric value])
else
NICKLEN="$withval"
fi
-], [NICKLEN=15])
+], [NICKLEN=50])
AC_ARG_WITH(topiclen,
AC_HELP_STRING([--with-topiclen=NUMBER],[Set the max topic length to NUMBER (default 390, max 390)]),
* /quote set maxclients <limit>
*/
default_max_clients = 1024;
+
+ /* nicklen: enforced nickname length (for this server only; must be 50 or smaller) */
+ nicklen = 30;
};
admin {
* /quote set maxclients <limit>
*/
default_max_clients = 1024;
+
+ /* nicklen: enforced nickname length (for this server only; must be 50 or smaller) */
+ nicklen = 30;
};
/* admin {}: contains admin information about the server. (OLD A:) */
int client_flood_message_time;
int client_flood_message_num;
+ unsigned int nicklen;
};
struct config_channel_entry
*s = '\0';
/* copy the nick and terminate it */
- rb_strlcpy(nick, parv[1], sizeof(nick));
+ rb_strlcpy(nick, parv[1], ConfigFileEntry.nicklen);
/* check the nickname is ok */
if(!clean_nick(nick, 1))
flood_endgrace(source_p);
/* terminate nick to NICKLEN, we dont want clean_nick() to error! */
- rb_strlcpy(nick, parv[1], sizeof(nick));
+ rb_strlcpy(nick, parv[1], ConfigFileEntry.nicklen);
/* check the nickname is ok */
if(!clean_nick(nick, 1))
}
/* nicklen is +1 */
- if(len >= NICKLEN)
+ if(len >= NICKLEN && len >= ConfigFileEntry.nicklen)
return 0;
return 1;
init_reject();
init_cache();
init_monitor();
- init_isupport();
construct_cflags_strings();
mod_add_path(MODULE_DIR "/autoload");
#endif
+ init_isupport();
+
init_bandb();
init_ssld();
#endif
}
+static void
+conf_set_serverinfo_nicklen(void *data)
+{
+ static int nicklen_set = 0;
+
+ if (nicklen_set)
+ return;
+
+ ConfigFileEntry.nicklen = *(unsigned int *) data;
+
+ if (ConfigFileEntry.nicklen > NICKLEN)
+ {
+ conf_report_error("Warning -- ignoring serverinfo::nicklen -- provided nicklen (%u) is greater than allowed nicklen (%u)",
+ ConfigFileEntry.nicklen, NICKLEN);
+ ConfigFileEntry.nicklen = NICKLEN;
+ }
+
+ nicklen_set = 1;
+}
+
static void
conf_set_modules_module(void *data)
{
{ "default_max_clients",CF_INT, NULL, 0, &ServerInfo.default_max_clients },
+ { "nicklen", CF_INT, conf_set_serverinfo_nicklen, 0, NULL },
+
{ "\0", 0, NULL, 0, NULL }
};
ServerInfo.default_max_clients = MAXCONNECTIONS;
+ ConfigFileEntry.nicklen = NICKLEN;
+
if (!alias_dict)
alias_dict = irc_dictionary_create(strcasecmp);
}
init_isupport(void)
{
static int maxmodes = MAXMODEPARAMS;
- static int nicklen = NICKLEN-1;
static int channellen = LOC_CHANNELLEN;
static int topiclen = TOPICLEN;
+ static int nicklen = NICKLEN - 1;
+ static int nicklen_usable;
+
+ nicklen_usable = ConfigFileEntry.nicklen - 1;
add_isupport("CHANTYPES", isupport_chantypes, NULL);
add_isupport("EXCEPTS", isupport_boolean, &ConfigChannel.use_except);
add_isupport("CASEMAPPING", isupport_string, "rfc1459");
add_isupport("CHARSET", isupport_string, "ascii");
add_isupport("NICKLEN", isupport_intptr, &nicklen);
+ add_isupport("NICKLEN_USABLE", isupport_intptr, &nicklen_usable);
add_isupport("CHANNELLEN", isupport_intptr, &channellen);
add_isupport("TOPICLEN", isupport_intptr, &topiclen);
add_isupport("ETRACE", isupport_string, "");