summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb.c
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-09-21 23:41:42 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-09-24 18:23:15 +0200
commit95f5e7963a36b7b68859ce91ae4b232088bbaa09 (patch)
treeb5216b8dc726d1539d9960a43957cb9da2e1ebd1 /src/db/sysdb.c
parent77f445dbaecc8e792e1ad42e3742800ad141bee0 (diff)
downloadsssd-95f5e7963a36b7b68859ce91ae4b232088bbaa09.tar.gz
sssd-95f5e7963a36b7b68859ce91ae4b232088bbaa09.tar.xz
sssd-95f5e7963a36b7b68859ce91ae4b232088bbaa09.zip
SYSDB: Remove unnecessary domain parameter from several sysdb calls
The domain can be read from the sysdb object. Removing the domain string makes the API more self-contained.
Diffstat (limited to 'src/db/sysdb.c')
-rw-r--r--src/db/sysdb.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index e949cafdc..1e5e8ada1 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -93,7 +93,6 @@ errno_t sysdb_dn_sanitize(TALLOC_CTX *mem_ctx, const char *input,
struct ldb_dn *sysdb_custom_subtree_dn(struct sysdb_ctx *sysdb,
TALLOC_CTX *mem_ctx,
- const char *domain,
const char *subtree_name)
{
errno_t ret;
@@ -111,7 +110,7 @@ struct ldb_dn *sysdb_custom_subtree_dn(struct sysdb_ctx *sysdb,
}
dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb, SYSDB_TMPL_CUSTOM_SUBTREE,
- clean_subtree, domain);
+ clean_subtree, sysdb->domain->name);
if (dn) {
talloc_steal(mem_ctx, dn);
}
@@ -119,9 +118,10 @@ struct ldb_dn *sysdb_custom_subtree_dn(struct sysdb_ctx *sysdb,
return dn;
}
+
struct ldb_dn *sysdb_custom_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
- const char *domain, const char *object_name,
- const char *subtree_name)
+ const char *object_name,
+ const char *subtree_name)
{
errno_t ret;
TALLOC_CTX *tmp_ctx;
@@ -145,7 +145,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, domain);
+ clean_subtree, sysdb->domain->name);
done:
talloc_free(tmp_ctx);
@@ -153,7 +153,7 @@ done:
}
struct ldb_dn *sysdb_user_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
- const char *domain, const char *name)
+ const char *name)
{
errno_t ret;
char *clean_name;
@@ -165,14 +165,14 @@ struct ldb_dn *sysdb_user_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
}
dn = ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_TMPL_USER,
- clean_name, domain);
+ clean_name, sysdb->domain->name);
talloc_free(clean_name);
return dn;
}
struct ldb_dn *sysdb_group_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
- const char *domain, const char *name)
+ const char *name)
{
errno_t ret;
char *clean_name;
@@ -184,14 +184,14 @@ struct ldb_dn *sysdb_group_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
}
dn = ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_TMPL_GROUP,
- clean_name, domain);
+ clean_name, sysdb->domain->name);
talloc_free(clean_name);
return dn;
}
struct ldb_dn *sysdb_netgroup_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
- const char *domain, const char *name)
+ const char *name)
{
errno_t ret;
char *clean_name;
@@ -203,16 +203,16 @@ struct ldb_dn *sysdb_netgroup_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
}
dn = ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_TMPL_NETGROUP,
- clean_name, domain);
+ clean_name, sysdb->domain->name);
talloc_free(clean_name);
return dn;
}
-struct ldb_dn *sysdb_netgroup_base_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
- const char *domain)
+struct ldb_dn *sysdb_netgroup_base_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx)
{
- return ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_TMPL_NETGROUP_BASE, domain);
+ return ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_TMPL_NETGROUP_BASE,
+ sysdb->domain->name);
}
errno_t sysdb_get_rdn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
@@ -279,10 +279,9 @@ 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,
- const char *domain)
+struct ldb_dn *sysdb_domain_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx)
{
- return ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_DOM_BASE, domain);
+ return ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_DOM_BASE, sysdb->domain->name);
}
struct ldb_context *sysdb_ctx_get_ldb(struct sysdb_ctx *sysdb)