Mercurial > dovecot > core-2.2
changeset 19678:338dd0ac1375
lib-sasl: Allow plugins to override the default SASL client mechanisms.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Fri, 29 Jan 2016 16:07:35 +0200 |
parents | a904c19c42ff |
children | 74f8b5be8f59 |
files | src/lib-sasl/dsasl-client.c |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-sasl/dsasl-client.c Fri Jan 29 15:09:35 2016 +0200 +++ b/src/lib-sasl/dsasl-client.c Fri Jan 29 16:07:35 2016 +0200 @@ -36,6 +36,12 @@ void dsasl_client_mech_register(const struct dsasl_client_mech *mech) { + unsigned int idx; + + if (dsasl_client_mech_find_idx(mech->name, &idx) != NULL) { + /* allow plugins to override the default mechanisms */ + array_delete(&dsasl_mechanisms, idx, 1); + } array_append(&dsasl_mechanisms, &mech, 1); }