diff options
author | Michael Adam <obnox@samba.org> | 2014-07-20 11:53:32 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2014-07-25 11:52:10 +0200 |
commit | 3ac00c9dc348733f0bb999a91a8faa6443ac99eb (patch) | |
tree | 8014a746f48a12c074a987da66796f8b532edec6 | |
parent | 3c6ec8908a697ac95536b35d242ccd64e524a0a5 (diff) | |
download | samba-3ac00c9dc348733f0bb999a91a8faa6443ac99eb.tar.gz samba-3ac00c9dc348733f0bb999a91a8faa6443ac99eb.tar.xz samba-3ac00c9dc348733f0bb999a91a8faa6443ac99eb.zip |
s3:idmap: in idmap_init_domain() load methods before loading further config
Check whether the requested backend exists at all, before going
further into the config parsing.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
-rw-r--r-- | source3/winbindd/idmap.c | 41 |
1 files changed, 23 insertions, 18 deletions
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index 33b397ce66..c76c35022d 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -186,6 +186,29 @@ static struct idmap_domain *idmap_init_domain(TALLOC_CTX *mem_ctx, } /* + * Check whether the requested backend module exists and + * load the methods. + */ + + result->methods = get_methods(modulename); + if (result->methods == NULL) { + DEBUG(3, ("idmap backend %s not found\n", modulename)); + + status = smb_probe_module("idmap", modulename); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(3, ("Could not probe idmap module %s\n", + modulename)); + goto fail; + } + + result->methods = get_methods(modulename); + } + if (result->methods == NULL) { + DEBUG(1, ("idmap backend %s not found\n", modulename)); + goto fail; + } + + /* * load ranges and read only information from the config */ @@ -226,24 +249,6 @@ static struct idmap_domain *idmap_init_domain(TALLOC_CTX *mem_ctx, } } - result->methods = get_methods(modulename); - if (result->methods == NULL) { - DEBUG(3, ("idmap backend %s not found\n", modulename)); - - status = smb_probe_module("idmap", modulename); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(3, ("Could not probe idmap module %s\n", - modulename)); - goto fail; - } - - result->methods = get_methods(modulename); - } - if (result->methods == NULL) { - DEBUG(1, ("idmap backend %s not found\n", modulename)); - goto fail; - } - status = result->methods->init(result); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("idmap initialization returned %s\n", |