summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-08 00:04:09 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:53:02 +0100
commit9a7b6d3248c5aac460e164f2246b26131cfbc055 (patch)
tree065a47207357e613c760afd580154df57dd54907 /src/db
parent2ca23577d3a25aead24ba759a1f6f67ffc24decf (diff)
downloadsssd-9a7b6d3248c5aac460e164f2246b26131cfbc055.tar.gz
sssd-9a7b6d3248c5aac460e164f2246b26131cfbc055.tar.bz2
sssd-9a7b6d3248c5aac460e164f2246b26131cfbc055.zip
Add domain argument to sysdb_idmap_ funcitons
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.h5
-rw-r--r--src/db/sysdb_idmap.c19
2 files changed, 11 insertions, 13 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 6fc71e1c..df0e1d37 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -845,16 +845,15 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx,
#define SYSDB_TMPL_IDMAP_BASE SYSDB_IDMAP_CONTAINER",cn=%s,"SYSDB_BASE
#define SYSDB_TMPL_IDMAP SYSDB_IDMAP_SID_ATTR"=%s,"SYSDB_TMPL_IDMAP_BASE
-struct ldb_dn *sysdb_idmap_dn(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
- const char *object_sid);
-
errno_t sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *dom_name,
const char *dom_sid,
id_t slice_num);
errno_t sysdb_idmap_get_mappings(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
struct ldb_result **_result);
#endif /* __SYS_DB_H__ */
diff --git a/src/db/sysdb_idmap.c b/src/db/sysdb_idmap.c
index eca3d1bd..612a42aa 100644
--- a/src/db/sysdb_idmap.c
+++ b/src/db/sysdb_idmap.c
@@ -24,9 +24,9 @@
#include "db/sysdb.h"
#include "db/sysdb_private.h"
-struct ldb_dn *
+static struct ldb_dn *
sysdb_idmap_dn(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
- const char *object_sid)
+ struct sss_domain_info *domain, const char *object_sid)
{
errno_t ret;
char *clean_sid;
@@ -37,11 +37,10 @@ sysdb_idmap_dn(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
return NULL;
}
- DEBUG(SSSDBG_TRACE_ALL,
- (SYSDB_TMPL_IDMAP"\n", clean_sid, sysdb->domain->name));
+ DEBUG(SSSDBG_TRACE_ALL, (SYSDB_TMPL_IDMAP"\n", clean_sid, domain->name));
dn = ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_TMPL_IDMAP,
- clean_sid, sysdb->domain->name);
+ clean_sid, domain->name);
talloc_free(clean_sid);
return dn;
@@ -49,6 +48,7 @@ sysdb_idmap_dn(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
errno_t
sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *dom_name,
const char *dom_sid,
id_t slice_num)
@@ -68,7 +68,7 @@ sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb,
tmp_ctx = talloc_new(NULL);
if (!tmp_ctx) return ENOMEM;
- dn = sysdb_idmap_dn(tmp_ctx, sysdb, dom_sid);
+ dn = sysdb_idmap_dn(tmp_ctx, sysdb, domain, dom_sid);
if (!dn) {
ret = ENOMEM;
goto done;
@@ -277,6 +277,7 @@ done:
errno_t
sysdb_idmap_get_mappings(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
struct ldb_result **_result)
{
errno_t ret;
@@ -289,12 +290,10 @@ sysdb_idmap_get_mappings(TALLOC_CTX *mem_ctx,
tmp_ctx = talloc_new(NULL);
if (!tmp_ctx) return ENOMEM;
- DEBUG(SSSDBG_TRACE_ALL,
- (SYSDB_TMPL_IDMAP_BASE"\n", sysdb->domain->name));
+ DEBUG(SSSDBG_TRACE_ALL, (SYSDB_TMPL_IDMAP_BASE"\n", domain->name));
base_dn = ldb_dn_new_fmt(tmp_ctx, sysdb->ldb,
- SYSDB_TMPL_IDMAP_BASE,
- sysdb->domain->name);
+ SYSDB_TMPL_IDMAP_BASE, domain->name);
if (!base_dn) {
ret = ENOMEM;
goto done;