From 83f7ffe7e5cb8110964209e86ce8e44b11f4088d Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 16 Jan 2013 18:30:52 +0000 Subject: - Forward-port -r1750 [IMPORTANT: nick and topic lengths are now configurable via ircd.conf. A max_nick_length, as well as a max_topic_length configuration option can now be found in the serverinfo{} block] - OpenSSL 0.9.8s and higher is now required in order to enable ssl support git-svn-id: svn://svn.ircd-hybrid.org/svnroot/ircd-hybrid/trunk@1751 82007160-df01-0410-b94d-b575c5fd34c7 --- modules/core/m_join.c | 2 +- modules/core/m_nick.c | 5 +++-- modules/core/m_sjoin.c | 2 +- modules/m_tburst.c | 2 +- modules/m_topic.c | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/core/m_join.c b/modules/core/m_join.c index 569663b..3eb6908 100644 --- a/modules/core/m_join.c +++ b/modules/core/m_join.c @@ -396,7 +396,7 @@ ms_join(struct Client *client_p, struct Client *source_p, if (chptr->topic[0]) { - set_channel_topic(chptr, "", "", 0); + set_channel_topic(chptr, "", "", 0, 0); sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s TOPIC %s :", (IsHidden(source_p) || ConfigServerHide.hide_servers) ? diff --git a/modules/core/m_nick.c b/modules/core/m_nick.c index 1250d2c..15d47af 100644 --- a/modules/core/m_nick.c +++ b/modules/core/m_nick.c @@ -43,6 +43,7 @@ #include "modules.h" #include "packet.h" #include "watch.h" +#include "s_misc.h" static void nick_from_server(struct Client *, struct Client *, int, char **, @@ -211,7 +212,7 @@ mr_nick(struct Client *client_p, struct Client *source_p, *s = '\0'; /* copy the nick and terminate it */ - strlcpy(nick, parv[1], sizeof(nick)); + strlcpy(nick, parv[1], IRCD_MIN(sizeof(nick), ServerInfo.max_nick_length + 1)); /* check the nickname is ok */ if (!valid_nickname(nick, 1)) @@ -278,7 +279,7 @@ m_nick(struct Client *client_p, struct Client *source_p, flood_endgrace(source_p); /* terminate nick to NICKLEN */ - strlcpy(nick, parv[1], sizeof(nick)); + strlcpy(nick, parv[1], IRCD_MIN(sizeof(nick), ServerInfo.max_nick_length + 1)); /* check the nickname is ok */ if (!valid_nickname(nick, 1)) diff --git a/modules/core/m_sjoin.c b/modules/core/m_sjoin.c index c817c99..53e442f 100644 --- a/modules/core/m_sjoin.c +++ b/modules/core/m_sjoin.c @@ -239,7 +239,7 @@ ms_sjoin(struct Client *client_p, struct Client *source_p, if (chptr->topic[0]) { - set_channel_topic(chptr, "", "", 0); + set_channel_topic(chptr, "", "", 0, 0); sendto_channel_local(ALL_MEMBERS, 0, chptr, ":%s TOPIC %s :", (IsHidden(source_p) || ConfigServerHide.hide_servers) ? diff --git a/modules/m_tburst.c b/modules/m_tburst.c index 43caef3..89e912c 100644 --- a/modules/m_tburst.c +++ b/modules/m_tburst.c @@ -94,7 +94,7 @@ ms_tburst(struct Client *client_p, struct Client *source_p, int topic_differs = strncmp(chptr->topic, topic, sizeof(chptr->topic) - 1); int hidden_server = (ConfigServerHide.hide_servers || IsHidden(source_p)); - set_channel_topic(chptr, topic, setby, remote_topic_ts); + set_channel_topic(chptr, topic, setby, remote_topic_ts, !!MyClient(source_p)); sendto_server(source_p, CAP_TBURST|CAP_TS6, NOCAPS, ":%s TBURST %s %s %s %s :%s", diff --git a/modules/m_topic.c b/modules/m_topic.c index fe4faea..d13c3b9 100644 --- a/modules/m_topic.c +++ b/modules/m_topic.c @@ -98,7 +98,7 @@ m_topic(struct Client *client_p, struct Client *source_p, snprintf(topic_info, sizeof(topic_info), "%s!%s@%s", source_p->name, source_p->username, source_p->host); - set_channel_topic(chptr, parv[2], topic_info, CurrentTime); + set_channel_topic(chptr, parv[2], topic_info, CurrentTime, !!MyClient(source_p)); sendto_server(client_p, CAP_TS6, NOCAPS, ":%s TOPIC %s :%s", -- cgit