summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-06 01:25:00 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:49:20 +0100
commit2ee09a30b020916ee7bf2f61f993ce7844897c1f (patch)
tree4e64630f50f7cb98076814bcdd60ffabddc8c43a
parent7c974e792beef952ceb19a01775c6d0ee71a1253 (diff)
downloadsssd-2ee09a30b020916ee7bf2f61f993ce7844897c1f.tar.gz
sssd-2ee09a30b020916ee7bf2f61f993ce7844897c1f.tar.bz2
sssd-2ee09a30b020916ee7bf2f61f993ce7844897c1f.zip
Make sysdb_netgroup_base_dn() require a domain.
-rw-r--r--src/db/sysdb.c8
-rw-r--r--src/db/sysdb.h4
-rw-r--r--src/providers/ldap/sdap_async_netgroups.c2
3 files changed, 9 insertions, 5 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index edfcef02..c79a6334 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -209,10 +209,12 @@ struct ldb_dn *sysdb_netgroup_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
return dn;
}
-struct ldb_dn *sysdb_netgroup_base_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx)
+struct ldb_dn *sysdb_netgroup_base_dn(struct sysdb_ctx *sysdb,
+ TALLOC_CTX *mem_ctx,
+ struct sss_domain_info *dom)
{
- return ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_TMPL_NETGROUP_BASE,
- sysdb->domain->name);
+ return ldb_dn_new_fmt(mem_ctx, sysdb->ldb,
+ SYSDB_TMPL_NETGROUP_BASE, dom->name);
}
errno_t sysdb_get_rdn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index fd00fa35..d558884b 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -328,7 +328,9 @@ struct ldb_dn *sysdb_group_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
struct sss_domain_info *dom, const char *name);
struct ldb_dn *sysdb_netgroup_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
struct sss_domain_info *dom, const char *name);
-struct ldb_dn *sysdb_netgroup_base_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx);
+struct ldb_dn *sysdb_netgroup_base_dn(struct sysdb_ctx *sysdb,
+ TALLOC_CTX *mem_ctx,
+ struct sss_domain_info *dom);
errno_t sysdb_group_dn_name(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
const char *dn_str, char **name);
struct ldb_dn *sysdb_domain_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx);
diff --git a/src/providers/ldap/sdap_async_netgroups.c b/src/providers/ldap/sdap_async_netgroups.c
index 12715d49..57a9b943 100644
--- a/src/providers/ldap/sdap_async_netgroups.c
+++ b/src/providers/ldap/sdap_async_netgroups.c
@@ -324,7 +324,7 @@ struct tevent_req *netgr_translate_members_send(TALLOC_CTX *memctx,
goto fail;
}
- netgr_basedn = sysdb_netgroup_base_dn(sysdb, state);
+ netgr_basedn = sysdb_netgroup_base_dn(sysdb, state, dom);
if (netgr_basedn == NULL) {
ret = ENOMEM;
goto fail;