summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-07 17:16:45 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-15 10:49:21 +0100
commit20d2466dbce2bb950813e3f739bc40b511020efb (patch)
treed3284cd515bcbd01f4ff844ab3bb59cb5badcdb3
parent3f94d6718d44185137e13b6d326dfd63e8dc61c6 (diff)
downloadsssd-20d2466dbce2bb950813e3f739bc40b511020efb.tar.gz
sssd-20d2466dbce2bb950813e3f739bc40b511020efb.tar.bz2
sssd-20d2466dbce2bb950813e3f739bc40b511020efb.zip
Add domain argument to sysdb_set_group_attr()
-rw-r--r--src/db/sysdb.h1
-rw-r--r--src/db/sysdb_ops.c9
-rw-r--r--src/tests/sysdb-tests.c24
-rw-r--r--src/tools/sss_cache.c2
-rw-r--r--src/tools/sss_sync_ops.c3
5 files changed, 21 insertions, 18 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h
index 2b514ddc..e96bc5a3 100644
--- a/src/db/sysdb.h
+++ b/src/db/sysdb.h
@@ -582,6 +582,7 @@ int sysdb_set_user_attr(struct sysdb_ctx *sysdb,
/* Replace group attrs */
int sysdb_set_group_attr(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *name,
struct sysdb_attrs *attrs,
int mod_op);
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index fba10277..80dd3e08 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -584,6 +584,7 @@ done:
/* =Replace-Attributes-On-Group=========================================== */
int sysdb_set_group_attr(struct sysdb_ctx *sysdb,
+ struct sss_domain_info *domain,
const char *name,
struct sysdb_attrs *attrs,
int mod_op)
@@ -598,7 +599,7 @@ int sysdb_set_group_attr(struct sysdb_ctx *sysdb,
goto done;
}
- dn = sysdb_group_dn(sysdb, tmp_ctx, sysdb->domain, name);
+ dn = sysdb_group_dn(sysdb, tmp_ctx, domain, name);
if (!dn) {
ret = ENOMEM;
goto done;
@@ -1361,7 +1362,7 @@ int sysdb_add_group(struct sysdb_ctx *sysdb,
(now + cache_timeout) : 0));
if (ret) goto done;
- ret = sysdb_set_group_attr(sysdb, name, attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_group_attr(sysdb, domain, name, attrs, SYSDB_MOD_REP);
done:
if (ret == EOK) {
@@ -1420,7 +1421,7 @@ int sysdb_add_incomplete_group(struct sysdb_ctx *sysdb,
if (ret) goto done;
}
- ret = sysdb_set_group_attr(sysdb, name, attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_group_attr(sysdb, sysdb->domain, name, attrs, SYSDB_MOD_REP);
done:
if (ret != EOK) {
@@ -1853,7 +1854,7 @@ int sysdb_store_group(struct sysdb_ctx *sysdb,
(now + cache_timeout) : 0));
if (ret) goto done;
- ret = sysdb_set_group_attr(sysdb, name, attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_group_attr(sysdb, sysdb->domain, name, attrs, SYSDB_MOD_REP);
done:
if (ret) {
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index baf1afe5..25d5fc9c 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -2112,8 +2112,8 @@ START_TEST (test_sysdb_memberof_mod_add)
}
/* Perform the add operation */
- ret = sysdb_set_group_attr(test_ctx->sysdb, data->groupname,
- data->attrs, SYSDB_MOD_ADD);
+ ret = sysdb_set_group_attr(test_ctx->sysdb, test_ctx->domain,
+ data->groupname, data->attrs, SYSDB_MOD_ADD);
fail_unless(ret == EOK, "Cannot set group attrs\n");
/* Before the delete, all groups with gid >= _i have the testuser%_i
@@ -2206,8 +2206,8 @@ START_TEST (test_sysdb_memberof_mod_replace)
}
/* Perform the replace operation */
- ret = sysdb_set_group_attr(test_ctx->sysdb, data->groupname,
- data->attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_group_attr(test_ctx->sysdb, test_ctx->domain,
+ data->groupname, data->attrs, SYSDB_MOD_REP);
fail_unless(ret == EOK, "Cannot set group attrs\n");
/* After the replace, all groups with gid >= _i have the testghost%_i
@@ -2335,8 +2335,8 @@ START_TEST (test_sysdb_memberof_mod_replace_keep)
}
/* Perform the replace operation */
- ret = sysdb_set_group_attr(test_ctx->sysdb, data->groupname,
- data->attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_group_attr(test_ctx->sysdb, test_ctx->domain,
+ data->groupname, data->attrs, SYSDB_MOD_REP);
fail_unless(ret == EOK, "Cannot set group attrs\n");
/* After the replace, testusera should still be there, but we also need
@@ -2874,8 +2874,8 @@ START_TEST (test_sysdb_memberof_mod_del)
}
/* Delete the attribute */
- ret = sysdb_set_group_attr(test_ctx->sysdb, data->groupname,
- data->attrs, SYSDB_MOD_DEL);
+ ret = sysdb_set_group_attr(test_ctx->sysdb, test_ctx->domain,
+ data->groupname, data->attrs, SYSDB_MOD_DEL);
fail_unless(ret == EOK, "Cannot set group attrs\n");
/* After the delete, we shouldn't be able to find the ghost attribute */
@@ -3123,8 +3123,8 @@ START_TEST (test_sysdb_memberof_ghost_replace)
fail_if(test_gv == NULL, "Cannot find ghost user %s\n", ghostname_del);
/* Perform the replace operation */
- ret = sysdb_set_group_attr(test_ctx->sysdb, data->groupname,
- data->attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_group_attr(test_ctx->sysdb, test_ctx->domain,
+ data->groupname, data->attrs, SYSDB_MOD_REP);
fail_unless(ret == EOK, "Cannot set group attrs\n");
/* After the replace, the group has the testghost%_i as a member */
@@ -3207,8 +3207,8 @@ START_TEST (test_sysdb_memberof_ghost_replace_noop)
fail_if(test_gv == NULL, "Cannot find ghost user %s\n", ghostname_del);
/* Perform the replace operation */
- ret = sysdb_set_group_attr(test_ctx->sysdb, data->groupname,
- data->attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_group_attr(test_ctx->sysdb, test_ctx->domain,
+ data->groupname, data->attrs, SYSDB_MOD_REP);
fail_unless(ret == EOK, "Cannot set group attrs\n");
/* After the replace, the group has the testghost%_i as a member */
diff --git a/src/tools/sss_cache.c b/src/tools/sss_cache.c
index b8f0f266..97657430 100644
--- a/src/tools/sss_cache.c
+++ b/src/tools/sss_cache.c
@@ -365,7 +365,7 @@ static errno_t invalidate_entry(TALLOC_CTX *ctx, struct sysdb_ctx *sysdb,
SYSDB_MOD_REP);
break;
case TYPE_GROUP:
- ret = sysdb_set_group_attr(sysdb, name, sys_attrs,
+ ret = sysdb_set_group_attr(sysdb, domain, name, sys_attrs,
SYSDB_MOD_REP);
break;
case TYPE_NETGROUP:
diff --git a/src/tools/sss_sync_ops.c b/src/tools/sss_sync_ops.c
index d6f447e7..34618825 100644
--- a/src/tools/sss_sync_ops.c
+++ b/src/tools/sss_sync_ops.c
@@ -273,7 +273,8 @@ int groupmod(TALLOC_CTX *mem_ctx,
return ret;
}
- ret = sysdb_set_group_attr(sysdb, data->name, attrs, SYSDB_MOD_REP);
+ ret = sysdb_set_group_attr(sysdb, data->domain, data->name,
+ attrs, SYSDB_MOD_REP);
if (ret) {
return ret;
}