summaryrefslogtreecommitdiff
path: root/src/db
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-06 01:09:05 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:49:20 +0100
commit52c72ae8587d8d47393a891ccd4ef06bd4bef856 (patch)
treea396907f3550ca171c216540db61f1f9b6cdc8d1 /src/db
parent3613cc1eba1337256a2d06ba7a84532156139ccd (diff)
downloadsssd-52c72ae8587d8d47393a891ccd4ef06bd4bef856.tar.gz
sssd-52c72ae8587d8d47393a891ccd4ef06bd4bef856.tar.bz2
sssd-52c72ae8587d8d47393a891ccd4ef06bd4bef856.zip
Make sysdb_group_dn() require a domain explictly.
Diffstat (limited to 'src/db')
-rw-r--r--src/db/sysdb.c4
-rw-r--r--src/db/sysdb.h2
-rw-r--r--src/db/sysdb_ops.c12
3 files changed, 9 insertions, 9 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c
index b7951d32..f7ca6401 100644
--- a/src/db/sysdb.c
+++ b/src/db/sysdb.c
@@ -172,7 +172,7 @@ struct ldb_dn *sysdb_user_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
}
struct ldb_dn *sysdb_group_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
- const char *name)
+ struct sss_domain_info *dom, const char *name)
{
errno_t ret;
char *clean_name;
@@ -184,7 +184,7 @@ 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, sysdb->domain->name);
+ clean_name, dom->name);
talloc_free(clean_name);
return dn;
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 5130b06a..2f77aa1e 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -325,7 +325,7 @@ errno_t sysdb_get_rdn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
struct ldb_dn *sysdb_user_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
struct sss_domain_info *dom, const char *name);
struct ldb_dn *sysdb_group_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
- const char *name);
+ struct sss_domain_info *dom, const char *name);
struct ldb_dn *sysdb_netgroup_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
const char *name);
struct ldb_dn *sysdb_netgroup_base_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx);
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 108f3b84..1f8c8315 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -351,7 +351,7 @@ int sysdb_search_group_by_name(TALLOC_CTX *mem_ctx,
return ENOMEM;
}
- basedn = sysdb_group_dn(sysdb, tmp_ctx, name);
+ basedn = sysdb_group_dn(sysdb, tmp_ctx, sysdb->domain, name);
if (!basedn) {
ret = ENOMEM;
goto done;
@@ -592,7 +592,7 @@ int sysdb_set_group_attr(struct sysdb_ctx *sysdb,
goto done;
}
- dn = sysdb_group_dn(sysdb, tmp_ctx, name);
+ dn = sysdb_group_dn(sysdb, tmp_ctx, sysdb->domain, name);
if (!dn) {
ret = ENOMEM;
goto done;
@@ -1223,7 +1223,7 @@ int sysdb_add_basic_group(struct sysdb_ctx *sysdb,
}
/* group dn */
- msg->dn = sysdb_group_dn(sysdb, msg, name);
+ msg->dn = sysdb_group_dn(sysdb, msg, sysdb->domain, name);
if (!msg->dn) {
ERROR_OUT(ret, ENOMEM, done);
}
@@ -1876,7 +1876,7 @@ sysdb_group_membership_mod(struct sysdb_ctx *sysdb,
if (type == SYSDB_MEMBER_USER) {
member_dn = sysdb_user_dn(sysdb, tmp_ctx, sysdb->domain, member);
} else if (type == SYSDB_MEMBER_GROUP) {
- member_dn = sysdb_group_dn(sysdb, tmp_ctx, member);
+ member_dn = sysdb_group_dn(sysdb, tmp_ctx, sysdb->domain, member);
} else {
ret = EINVAL;
goto done;
@@ -1887,7 +1887,7 @@ sysdb_group_membership_mod(struct sysdb_ctx *sysdb,
goto done;
}
- group_dn = sysdb_group_dn(sysdb, tmp_ctx, group);
+ group_dn = sysdb_group_dn(sysdb, tmp_ctx, sysdb->domain, group);
if (!group_dn) {
ret = ENOMEM;
goto done;
@@ -3049,7 +3049,7 @@ errno_t sysdb_remove_attrs(struct sysdb_ctx *sysdb,
break;
case SYSDB_MEMBER_GROUP:
- msg->dn = sysdb_group_dn(sysdb, msg, name);
+ msg->dn = sysdb_group_dn(sysdb, msg, sysdb->domain, name);
break;
case SYSDB_MEMBER_NETGROUP: