summaryrefslogtreecommitdiff
path: root/source3/param
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2013-01-29 13:24:20 +0100
committerMichael Adam <obnox@samba.org>2013-02-05 17:36:34 +0100
commit321401e7d1c812d70aa44350de0386a12d9c25f4 (patch)
treecd20c85564e62980904cfeadde705fff2b295ecf /source3/param
parent4198e800d809cd0b7be5a0214a22b9a31b906cc4 (diff)
downloadsamba-321401e7d1c812d70aa44350de0386a12d9c25f4.tar.gz
samba-321401e7d1c812d70aa44350de0386a12d9c25f4.tar.bz2
samba-321401e7d1c812d70aa44350de0386a12d9c25f4.zip
s3:param: introduce new lp_idmap_backend() that takes the domain
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
Diffstat (limited to 'source3/param')
-rw-r--r--source3/param/loadparm.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 961a002eb1..dab6d34040 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -2955,6 +2955,33 @@ bool lp_idmap_default_range(uint32_t *low, uint32_t *high)
return lp_idmap_range("*", low, high);
}
+const char *lp_idmap_backend(const char *domain_name)
+{
+ char *config_option = NULL;
+ const char *backend = NULL;
+
+ if ((domain_name == NULL) || (domain_name[0] == '\0')) {
+ domain_name = "*";
+ }
+
+ config_option = talloc_asprintf(talloc_tos(), "idmap config %s",
+ domain_name);
+ if (config_option == NULL) {
+ DEBUG(0, ("out of memory\n"));
+ return false;
+ }
+
+ backend = lp_parm_const_string(-1, config_option, "backend", NULL);
+ if (backend == NULL) {
+ DEBUG(1, ("idmap backend not specified for domain '%s'\n", domain_name));
+ goto done;
+ }
+
+done:
+ talloc_free(config_option);
+ return backend;
+}
+
/***************************************************************************
Handle the DEBUG level list.
***************************************************************************/