Merge pull request #294 from edk0/deny-webirc-auth

m_webirc: deny using webirc. as a real auth block
This commit is contained in:
Aaron Jones 2019-10-22 16:16:36 +00:00 committed by GitHub
commit 9e6c36d571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,7 +64,13 @@ struct Message webirc_msgtab = {
mapi_clist_av1 webirc_clist[] = { &webirc_msgtab, NULL };
DECLARE_MODULE_AV2(webirc, NULL, NULL, webirc_clist, NULL, NULL, NULL, NULL, webirc_desc);
static void new_local_user(void *data);
mapi_hfn_list_av1 webirc_hfnlist[] = {
{ "new_local_user", (hookfn) new_local_user },
{ NULL, NULL }
};
DECLARE_MODULE_AV2(webirc, NULL, NULL, webirc_clist, NULL, webirc_hfnlist, NULL, NULL, webirc_desc);
/*
* mr_webirc - webirc message handler
@ -140,3 +146,13 @@ mr_webirc(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
sendto_one(source_p, "NOTICE * :CGI:IRC host/IP set to %s %s", parv[3], parv[4]);
}
static void
new_local_user(void *data)
{
struct Client *source_p = data;
struct ConfItem *aconf = source_p->localClient->att_conf;
if (!irccmp(aconf->info.name, "webirc."))
exit_client(source_p, source_p, &me, "Cannot log in using a WEBIRC block");
}