This will return the passdb domain if the given sid is in our sam or builtin
or is the domain sid of those domains. Otherwise it returns the idmap domain
that results from the idmap configuration.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
return result;
}
+struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
+ const struct dom_sid *sid)
+{
+ idmap_init();
+
+ if (sid_check_is_in_builtin(sid) ||
+ sid_check_is_builtin(sid) ||
+ sid_check_is_in_our_sam(sid) ||
+ sid_check_is_our_sam(sid))
+ {
+ return idmap_passdb_domain(NULL);
+ }
+
+ return idmap_find_domain(domname);
+}
+
void idmap_close(void)
{
TALLOC_FREE(default_idmap_domain);
void init_idmap_child(void);
struct winbindd_child *idmap_child(void);
struct idmap_domain *idmap_find_domain(const char *domname);
+struct idmap_domain *idmap_find_domain_with_sid(const char *domname,
+ const struct dom_sid *sid);
/* The following definitions come from winbindd/winbindd_locator.c */