From 770896b194b7b66b09c2a30545b4d091fd86b1f4 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 7 Jan 2013 22:15:14 -0500 Subject: Add domain argument to sysdb_search_custom() Also changes sysdb_search_custom_by_name() --- src/providers/ipa/ipa_hbac_hosts.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/providers/ipa/ipa_hbac_hosts.c') diff --git a/src/providers/ipa/ipa_hbac_hosts.c b/src/providers/ipa/ipa_hbac_hosts.c index 23f7816b..474a3975 100644 --- a/src/providers/ipa/ipa_hbac_hosts.c +++ b/src/providers/ipa/ipa_hbac_hosts.c @@ -30,6 +30,7 @@ */ static errno_t hbac_host_attrs_to_rule(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, const char *rule_name, struct sysdb_attrs *rule_attrs, const char *category_attr, @@ -114,7 +115,7 @@ static errno_t hbac_host_attrs_to_rule(TALLOC_CTX *mem_ctx, } /* First check if this is a specific host */ - ret = sysdb_search_custom(tmp_ctx, sysdb, filter, + ret = sysdb_search_custom(tmp_ctx, sysdb, domain, filter, HBAC_HOSTS_SUBDIR, attrs, &count, &msgs); if (ret != EOK && ret != ENOENT) goto done; @@ -150,7 +151,7 @@ static errno_t hbac_host_attrs_to_rule(TALLOC_CTX *mem_ctx, num_hosts++; } else { /* ret == ENOENT */ /* Check if this is a hostgroup */ - ret = sysdb_search_custom(tmp_ctx, sysdb, filter, + ret = sysdb_search_custom(tmp_ctx, sysdb, domain, filter, HBAC_HOSTGROUPS_SUBDIR, attrs, &count, &msgs); if (ret != EOK && ret != ENOENT) goto done; @@ -225,13 +226,14 @@ done: errno_t hbac_thost_attrs_to_rule(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, const char *rule_name, struct sysdb_attrs *rule_attrs, struct hbac_rule_element **thosts) { DEBUG(7, ("Processing target hosts for rule [%s]\n", rule_name)); - return hbac_host_attrs_to_rule(mem_ctx, sysdb, + return hbac_host_attrs_to_rule(mem_ctx, sysdb, domain, rule_name, rule_attrs, IPA_HOST_CATEGORY, IPA_MEMBER_HOST, NULL, thosts); @@ -240,6 +242,7 @@ hbac_thost_attrs_to_rule(TALLOC_CTX *mem_ctx, errno_t hbac_shost_attrs_to_rule(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, const char *rule_name, struct sysdb_attrs *rule_attrs, bool support_srchost, @@ -270,7 +273,7 @@ hbac_shost_attrs_to_rule(TALLOC_CTX *mem_ctx, goto done; } - ret = hbac_host_attrs_to_rule(tmp_ctx, sysdb, + ret = hbac_host_attrs_to_rule(tmp_ctx, sysdb, domain, rule_name, rule_attrs, IPA_SOURCE_HOST_CATEGORY, IPA_SOURCE_HOST, &host_count, &shosts); -- cgit