summaryrefslogtreecommitdiffstats
path: root/src/tests
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2012-11-17 23:55:13 +0100
committerJakub Hrozek <jhrozek@redhat.com>2012-11-21 11:18:10 +0100
commitf9111f464376338317e30da637353e2c25869ce8 (patch)
tree603e9228acbc691955a19e104865f1e21659c0ff /src/tests
parentfcea2fb0044b50b54bb02238782b6631dbc9bb90 (diff)
downloadsssd-f9111f464376338317e30da637353e2c25869ce8.tar.gz
sssd-f9111f464376338317e30da637353e2c25869ce8.tar.xz
sssd-f9111f464376338317e30da637353e2c25869ce8.zip
LDAP: Only convert direct parents' ghost attribute to member
https://fedorahosted.org/sssd/ticket/1612 This patch changes the handling of ghost attributes when saving the actual user entry. Instead of always linking all groups that contained the ghost attribute with the new user entry, the original member attributes are now saved in the group object and the user entry is only linked with its direct parents. As the member attribute is compared against the originalDN of the user, if either the originalDN or the originalMember attributes are missing, the user object is linked with all the groups as a fallback. The original member attributes are only saved if the LDAP schema supports nesting.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/sysdb-tests.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index d9afe7b88..2b8b92d60 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -191,7 +191,7 @@ static int test_add_user(struct test_data *data)
ret = sysdb_add_user(data->ctx->sysdb, data->username,
data->uid, 0, gecos, homedir, "/bin/bash",
- NULL, 0, 0);
+ NULL, NULL, 0, 0);
return ret;
}
@@ -207,7 +207,7 @@ static int test_store_user(struct test_data *data)
ret = sysdb_store_user(data->ctx->sysdb, data->username, "x",
data->uid, 0, gecos, homedir,
data->shell ? data->shell : "/bin/bash",
- NULL, NULL, -1, 0);
+ NULL, NULL, NULL, -1, 0);
return ret;
}
@@ -2260,7 +2260,8 @@ START_TEST(test_user_rename)
/* Store and verify the first user */
ret = sysdb_store_user(test_ctx->sysdb, fromname, NULL, userid, 0,
- fromname, "/", "/bin/sh", NULL, NULL, 0, 0);
+ fromname, "/", "/bin/sh",
+ NULL, NULL, NULL, 0, 0);
fail_unless(ret == EOK, "Could not add first user");
ret = sysdb_getpwnam(test_ctx, test_ctx->sysdb, fromname, &res);
@@ -2281,11 +2282,11 @@ START_TEST(test_user_rename)
/* Perform rename and check that GID is the same, but name changed */
ret = sysdb_add_user(test_ctx->sysdb, toname, userid, 0,
- fromname, "/", "/bin/sh", NULL, 0, 0);
+ fromname, "/", "/bin/sh", NULL, NULL, 0, 0);
fail_unless(ret == EEXIST, "A second user added with low level call?");
ret = sysdb_store_user(test_ctx->sysdb, toname, NULL, userid, 0,
- fromname, "/", "/bin/sh", NULL, NULL, 0, 0);
+ fromname, "/", "/bin/sh", NULL, NULL, NULL, 0, 0);
fail_unless(ret == EOK, "Could not add second user");
ret = sysdb_getpwnam(test_ctx, test_ctx->sysdb, toname, &res);
@@ -3484,7 +3485,7 @@ START_TEST(test_sysdb_subdomain_store_user)
ret = sysdb_store_user(subdomain->sysdb, "subdomuser", NULL, 12345, 0,
"Sub Domain User", "/home/subdomuser", "/bin/bash",
- NULL, NULL, -1, 0);
+ NULL, NULL, NULL, -1, 0);
fail_unless(ret == EOK, "sysdb_store_user failed.");
base_dn =ldb_dn_new(test_ctx, test_ctx->sysdb->ldb, "cn=sysdb");