Merge pull request #351 from ophion-project/upstream/sasl

sasl: use mapi_cap_list_v2 correctly
This commit is contained in:
Simon Arlott 2020-07-12 10:28:02 +01:00 committed by GitHub
commit 373ba193b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,13 +109,17 @@ static struct ClientCapability capdata_sasl = {
.flags = CLICAP_FLAGS_STICKY, .flags = CLICAP_FLAGS_STICKY,
}; };
mapi_cap_list_av2 sasl_cap_list[] = {
{ MAPI_CAP_CLIENT, "sasl", &capdata_sasl, &CLICAP_SASL },
{ 0, NULL, NULL, NULL },
};
static int static int
_modinit(void) _modinit(void)
{ {
memset(mechlist_buf, 0, sizeof mechlist_buf); memset(mechlist_buf, 0, sizeof mechlist_buf);
sasl_agent_present = false; sasl_agent_present = false;
CLICAP_SASL = capability_put(cli_capindex, "sasl", &capdata_sasl);
advertise_sasl_config(NULL); advertise_sasl_config(NULL);
return 0; return 0;
} }
@ -124,10 +128,9 @@ static void
_moddeinit(void) _moddeinit(void)
{ {
advertise_sasl_cap(false); advertise_sasl_cap(false);
capability_orphan(cli_capindex, "sasl");
} }
DECLARE_MODULE_AV2(sasl, _modinit, _moddeinit, sasl_clist, NULL, sasl_hfnlist, NULL, NULL, sasl_desc); DECLARE_MODULE_AV2(sasl, _modinit, _moddeinit, sasl_clist, NULL, sasl_hfnlist, sasl_cap_list, NULL, sasl_desc);
static void static void
m_authenticate(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, m_authenticate(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p,