From b6b40dda240972cd6b844cacdb99ccd7bdca9024 Mon Sep 17 00:00:00 2001 From: Ed Kellett Date: Thu, 19 Aug 2021 20:33:55 +0100 Subject: [PATCH] Make new_local_user hooks handle dead clients --- extensions/drain.c | 5 ++++- extensions/m_webirc.c | 3 +++ extensions/sasl_usercloak.c | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/extensions/drain.c b/extensions/drain.c index 01d19cdf..9829eeb6 100644 --- a/extensions/drain.c +++ b/extensions/drain.c @@ -22,10 +22,13 @@ check_new_user(void *vdata) struct Client *source_p = vdata; const char *drain_reason = ConfigFileEntry.drain_reason; + if (IsAnyDead(source_p)) + return; + if (drain_reason == NULL) drain_reason = "This server is not accepting connections."; - if(IsExemptKline(source_p)) + if (IsExemptKline(source_p)) return; exit_client(source_p, source_p, &me, drain_reason); diff --git a/extensions/m_webirc.c b/extensions/m_webirc.c index 99ae7d42..f169435d 100644 --- a/extensions/m_webirc.c +++ b/extensions/m_webirc.c @@ -191,6 +191,9 @@ new_local_user(void *data) struct Client *source_p = data; struct ConfItem *aconf = source_p->localClient->att_conf; + if (aconf == NULL) + return; + if (!irccmp(aconf->info.name, "webirc.")) exit_client(source_p, source_p, &me, "Cannot log in using a WEBIRC block"); } diff --git a/extensions/sasl_usercloak.c b/extensions/sasl_usercloak.c index 70001b7f..cb4b91ad 100644 --- a/extensions/sasl_usercloak.c +++ b/extensions/sasl_usercloak.c @@ -40,6 +40,9 @@ check_new_user(void *vdata) { struct Client *source_p = vdata; + if (IsAnyDead(source_p)) + return; + if (!IsIPSpoof(source_p)) return;