From fb80e1158bb1a14f2602e65464909a213296cde1 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 10 Mar 2016 10:38:29 +0100 Subject: [PATCH] s3:winbindd:idmap: add domain_has_idmap_config() helper function. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11786 Pair-Programmed-With: Guenther Deschner Signed-off-by: Michael Adam Signed-off-by: Guenther Deschner Reviewed-by: Jeremy Allison --- source3/winbindd/idmap.c | 15 +++++++++++++++ source3/winbindd/winbindd_proto.h | 1 + 2 files changed, 16 insertions(+) diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index 4012e70d9f0..39ee230a3d5 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -120,6 +120,21 @@ static bool idmap_init(void) return true; } +bool domain_has_idmap_config(const char *domname) +{ + int i; + + idmap_init(); + + for (i=0; iname, domname)) { + return true; + } + } + + return false; +} + static bool idmap_found_domain_backend( const char *string, regmatch_t matches[], void *private_data) { diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index dd389c21978..12629ffd05a 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -330,6 +330,7 @@ void init_idmap_child(void); struct winbindd_child *idmap_child(void); struct idmap_domain *idmap_find_domain_with_sid(const char *domname, const struct dom_sid *sid); +bool domain_has_idmap_config(const char *domname); /* The following definitions come from winbindd/winbindd_locator.c */ -- 2.11.4.GIT