Make new_local_user hooks handle dead clients

This commit is contained in:
Ed Kellett 2021-08-19 20:33:55 +01:00
parent e83449d5be
commit b6b40dda24
3 changed files with 10 additions and 1 deletions

View file

@ -22,10 +22,13 @@ check_new_user(void *vdata)
struct Client *source_p = vdata; struct Client *source_p = vdata;
const char *drain_reason = ConfigFileEntry.drain_reason; const char *drain_reason = ConfigFileEntry.drain_reason;
if (IsAnyDead(source_p))
return;
if (drain_reason == NULL) if (drain_reason == NULL)
drain_reason = "This server is not accepting connections."; drain_reason = "This server is not accepting connections.";
if(IsExemptKline(source_p)) if (IsExemptKline(source_p))
return; return;
exit_client(source_p, source_p, &me, drain_reason); exit_client(source_p, source_p, &me, drain_reason);

View file

@ -191,6 +191,9 @@ new_local_user(void *data)
struct Client *source_p = data; struct Client *source_p = data;
struct ConfItem *aconf = source_p->localClient->att_conf; struct ConfItem *aconf = source_p->localClient->att_conf;
if (aconf == NULL)
return;
if (!irccmp(aconf->info.name, "webirc.")) if (!irccmp(aconf->info.name, "webirc."))
exit_client(source_p, source_p, &me, "Cannot log in using a WEBIRC block"); exit_client(source_p, source_p, &me, "Cannot log in using a WEBIRC block");
} }

View file

@ -40,6 +40,9 @@ check_new_user(void *vdata)
{ {
struct Client *source_p = vdata; struct Client *source_p = vdata;
if (IsAnyDead(source_p))
return;
if (!IsIPSpoof(source_p)) if (!IsIPSpoof(source_p))
return; return;