Mercurial > dovecot > core-2.2
changeset 21231:60ada98565d8
lib-dcrypt: Add module_dir setting
This is needed for unit tests that require
dcrypt, so that they can load backend
without installing it first.
author | Aki Tuomi <aki.tuomi@dovecot.fi> |
---|---|
date | Fri, 25 Nov 2016 09:48:43 +0200 |
parents | fe3004724de3 |
children | 7bb1cb2102d4 |
files | src/lib-dcrypt/dcrypt.c src/lib-dcrypt/dcrypt.h |
diffstat | 2 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-dcrypt/dcrypt.c Fri Nov 25 16:14:16 2016 +0200 +++ b/src/lib-dcrypt/dcrypt.c Fri Nov 25 09:48:43 2016 +0200 @@ -5,7 +5,9 @@ static struct module *dcrypt_module = NULL; static struct dcrypt_vfs *dcrypt_vfs = NULL; -static const struct dcrypt_settings dcrypt_default_set; +static const struct dcrypt_settings dcrypt_default_set = { + .module_dir = DCRYPT_MODULE_DIR, +}; bool dcrypt_initialize(const char *backend, const struct dcrypt_settings *set, const char **error_r) { @@ -24,7 +26,7 @@ memset(&mod_set, 0, sizeof(mod_set)); mod_set.abi_version = DOVECOT_ABI_VERSION; mod_set.require_init_funcs = TRUE; - if (module_dir_try_load_missing(&dcrypt_module, DCRYPT_MODULE_DIR, + if (module_dir_try_load_missing(&dcrypt_module, set->module_dir, implementation, &mod_set, &error) < 0) { if (error_r != NULL) *error_r = error;