summaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-06 01:39:03 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:49:20 +0100
commitde526c8425886ca3bed8f07a0f092ba5ac325654 (patch)
tree14e700518dec7dfe3a4d3f64f990f8566081fe2b /src/db
parent4b49384056874e7999d8338ce5288f3d5c27a7b8 (diff)
downloadsssd-de526c8425886ca3bed8f07a0f092ba5ac325654.tar.gz
sssd-de526c8425886ca3bed8f07a0f092ba5ac325654.tar.xz
sssd-de526c8425886ca3bed8f07a0f092ba5ac325654.zip
Make sysdb_custom_dn() require a domain.
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.c3
-rw-r--r--src/db/sysdb.h1
-rw-r--r--src/db/sysdb_autofs.c3
-rw-r--r--src/db/sysdb_ops.c9
4 files changed, 11 insertions, 5 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index 895125292..2f58d70d7 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -120,6 +120,7 @@ struct ldb_dn *sysdb_custom_subtree_dn(struct sysdb_ctx *sysdb,
}
struct ldb_dn *sysdb_custom_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
+ struct sss_domain_info *dom,
const char *object_name,
const char *subtree_name)
{
@@ -145,7 +146,7 @@ struct ldb_dn *sysdb_custom_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
}
dn = ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_TMPL_CUSTOM, clean_name,
- clean_subtree, sysdb->domain->name);
+ clean_subtree, dom->name);
done:
talloc_free(tmp_ctx);
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 3a5e36dac..fd1d7c819 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -337,6 +337,7 @@ 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,
+ struct sss_domain_info *dom,
const char *object_name,
const char *subtree_name);
struct ldb_dn *sysdb_custom_subtree_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
diff --git a/src/db/sysdb_autofs.c b/src/db/sysdb_autofs.c
index 57380cfdc..446b3cacf 100644
--- a/src/db/sysdb_autofs.c
+++ b/src/db/sysdb_autofs.c
@@ -31,7 +31,8 @@ sysdb_autofsmap_dn(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
const char *map_name)
{
- return sysdb_custom_dn(sysdb, mem_ctx, map_name, AUTOFS_MAP_SUBDIR);
+ return sysdb_custom_dn(sysdb, mem_ctx,
+ sysdb->domain, map_name, AUTOFS_MAP_SUBDIR);
}
static struct ldb_dn *
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 4b0e16767..b70e0966b 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -2037,7 +2037,8 @@ int sysdb_search_custom_by_name(TALLOC_CTX *mem_ctx,
return ENOMEM;
}
- basedn = sysdb_custom_dn(sysdb, tmp_ctx, object_name, subtree_name);
+ basedn = sysdb_custom_dn(sysdb, tmp_ctx,
+ sysdb->domain, object_name, subtree_name);
if (basedn == NULL) {
DEBUG(1, ("sysdb_custom_dn failed.\n"));
ret = ENOMEM;
@@ -2119,7 +2120,8 @@ int sysdb_store_custom(struct sysdb_ctx *sysdb,
goto done;
}
- msg->dn = sysdb_custom_dn(sysdb, tmp_ctx, object_name, subtree_name);
+ msg->dn = sysdb_custom_dn(sysdb, tmp_ctx,
+ sysdb->domain, object_name, subtree_name);
if (!msg->dn) {
DEBUG(1, ("sysdb_custom_dn failed.\n"));
ret = ENOMEM;
@@ -2189,7 +2191,8 @@ int sysdb_delete_custom(struct sysdb_ctx *sysdb,
return ENOMEM;
}
- dn = sysdb_custom_dn(sysdb, tmp_ctx, object_name, subtree_name);
+ dn = sysdb_custom_dn(sysdb, tmp_ctx,
+ sysdb->domain, object_name, subtree_name);
if (dn == NULL) {
DEBUG(1, ("sysdb_custom_dn failed.\n"));
ret = ENOMEM;