From 208f4a504b70d9064e46a5959e30c3026a98d11f Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sun, 3 Jan 2016 10:28:15 +0100 Subject: [PATCH] SSL Fingerprint wasn't broadcasted correctly to other servers. For Unreal this only affected WHOIS since extban +e/+I ~S:xxx worked fine (only checked locally). But this also prevented services from being informed, IOTW: services could not make use of this new certfp feature yet. --- include/h.h | 1 + src/moddata.c | 16 +++++++++++++++- src/modules/m_nick.c | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/h.h b/include/h.h index e9bfb75a4b..baf969cc77 100644 --- a/include/h.h +++ b/include/h.h @@ -756,3 +756,4 @@ extern void convert_to_absolute_path(char **path, char *reldir); extern int has_channel_mode(aChannel *chptr, char mode); extern void start_listeners(void); extern void buildvarstring(char *inbuf, char *outbuf, size_t len, char *name[], char *value[]); +extern void broadcast_moddata_client(aClient *acptr); diff --git a/src/moddata.c b/src/moddata.c index 78bf915018..2a5e703efc 100644 --- a/src/moddata.c +++ b/src/moddata.c @@ -309,6 +309,17 @@ ModDataInfo *mdi; } } +/** Broadcast moddata attached to client 'acptr' to all servers. */ +void broadcast_moddata_client(aClient *acptr) +{ + aClient *cptr; + + list_for_each_entry(cptr, &server_list, special_node) + { + send_moddata_client(cptr, acptr); + } +} + /** Send all moddata attached to channel 'chptr' to remote server 'srv' (if the module wants this), called by SJOIN */ void send_moddata_channel(aClient *srv, aChannel *chptr) { @@ -400,7 +411,10 @@ int moddata_client_set(aClient *acptr, char *varname, char *value) memset(&moddata_client(acptr, md), 0, sizeof(ModData)); } - if (md->sync) + /* If 'sync' field is set and the user is not in pre-registered state then + * broadcast the new setting. + */ + if (md->sync && IsPerson(acptr)) { if (value) sendto_server(NULL, 0, 0, ":%s MD %s %s %s :%s", diff --git a/src/modules/m_nick.c b/src/modules/m_nick.c index f5ae951a56..5531c0c844 100644 --- a/src/modules/m_nick.c +++ b/src/modules/m_nick.c @@ -1528,6 +1528,7 @@ int _register_user(aClient *cptr, aClient *sptr, char *nick, char *username, cha if (MyConnect(sptr)) { + broadcast_moddata_client(sptr); sendto_connectnotice(sptr, 0, NULL); /* moved down, for modules. */ /* Send password from sptr->local->passwd to NickServ for identification,