summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-06 01:30:27 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:49:20 +0100
commit4b49384056874e7999d8338ce5288f3d5c27a7b8 (patch)
tree964b1d072be88b971138912fc57e809bbe78dd71 /src
parent2ee09a30b020916ee7bf2f61f993ce7844897c1f (diff)
downloadsssd-4b49384056874e7999d8338ce5288f3d5c27a7b8.tar.gz
sssd-4b49384056874e7999d8338ce5288f3d5c27a7b8.tar.bz2
sssd-4b49384056874e7999d8338ce5288f3d5c27a7b8.zip
Make sysdb_domain_dn() require a domain.
Diffstat (limited to 'src')
-rw-r--r--src/db/sysdb.c6
-rw-r--r--src/db/sysdb.h3
-rw-r--r--src/db/sysdb_ops.c2
-rw-r--r--src/providers/ldap/sdap_async_groups.c2
-rw-r--r--src/responder/pac/pacsrv_utils.c2
-rw-r--r--src/tests/sysdb-tests.c2
6 files changed, 10 insertions, 7 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index c79a6334..89512529 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -281,10 +281,12 @@ errno_t sysdb_group_dn_name(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
return sysdb_get_rdn(sysdb, mem_ctx, _dn, NULL, _name);
}
-struct ldb_dn *sysdb_domain_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx)
+struct ldb_dn *sysdb_domain_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
+ struct sss_domain_info *dom)
{
- return ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_DOM_BASE, sysdb->domain->name);
+ return ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_DOM_BASE, dom->name);
}
+
struct ldb_dn *sysdb_base_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx)
{
return ldb_dn_new(mem_ctx, sysdb->ldb, SYSDB_BASE);
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index d558884b..3a5e36da 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -333,7 +333,8 @@ struct ldb_dn *sysdb_netgroup_base_dn(struct sysdb_ctx *sysdb,
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);
+struct ldb_dn *sysdb_domain_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
+ struct sss_domain_info *dom);
struct ldb_dn *sysdb_base_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx);
struct ldb_dn *sysdb_custom_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
const char *object_name,
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 2364f17b..4b0e1676 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -663,7 +663,7 @@ int sysdb_get_new_id(struct sysdb_ctx *sysdb,
return ENOMEM;
}
- base_dn = sysdb_domain_dn(sysdb, tmp_ctx);
+ base_dn = sysdb_domain_dn(sysdb, tmp_ctx, sysdb->domain);
if (!base_dn) {
talloc_zfree(tmp_ctx);
return ENOMEM;
diff --git a/src/providers/ldap/sdap_async_groups.c b/src/providers/ldap/sdap_async_groups.c
index ae335fc8..fe540e8c 100644
--- a/src/providers/ldap/sdap_async_groups.c
+++ b/src/providers/ldap/sdap_async_groups.c
@@ -61,7 +61,7 @@ static int sdap_find_entry_by_origDN(TALLOC_CTX *memctx,
goto done;
}
- base_dn = sysdb_domain_dn(ctx, tmpctx);
+ base_dn = sysdb_domain_dn(ctx, tmpctx, domain);
if (!base_dn) {
ret = ENOMEM;
goto done;
diff --git a/src/responder/pac/pacsrv_utils.c b/src/responder/pac/pacsrv_utils.c
index a55ba0f3..202f7ba3 100644
--- a/src/responder/pac/pacsrv_utils.c
+++ b/src/responder/pac/pacsrv_utils.c
@@ -283,7 +283,7 @@ errno_t get_my_domain_data(struct pac_ctx *pac_ctx,
goto done;
}
- basedn = sysdb_domain_dn(sysdb, tmp_ctx);
+ basedn = sysdb_domain_dn(sysdb, tmp_ctx, dom);
if (basedn == NULL) {
ret = ENOMEM;
goto done;
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index 834b4117..351c07d0 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -4213,7 +4213,7 @@ START_TEST(test_sysdb_original_dn_case_insensitive)
"cn=case_sensitive_group1,cn=example,cn=com");
fail_if(filter == NULL, "Cannot construct filter\n");
- base_dn = sysdb_domain_dn(test_ctx->sysdb, test_ctx);
+ base_dn = sysdb_domain_dn(test_ctx->sysdb, test_ctx, test_ctx->domain);
fail_if(base_dn == NULL, "Cannot construct basedn\n");
ret = sysdb_search_entry(test_ctx, test_ctx->sysdb,