summaryrefslogtreecommitdiffstats
path: root/src/tests/sysdb-tests.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2015-04-22 16:57:37 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-04-29 11:33:22 +0200
commitf70a1adbfc30b9acc302027439fb8157e0c6ea2a (patch)
treeb65879cc54087e6e7fcc5aea4e2b86a4de3d1683 /src/tests/sysdb-tests.c
parent82a958e6592c4a4078e45b7197bbe4751b70f511 (diff)
downloadsssd-f70a1adbfc30b9acc302027439fb8157e0c6ea2a.tar.gz
sssd-f70a1adbfc30b9acc302027439fb8157e0c6ea2a.tar.xz
sssd-f70a1adbfc30b9acc302027439fb8157e0c6ea2a.zip
IPA: allow initgroups by SID for AD users
If a user from a trusted AD domain is search with the help of an override name the SID from the override anchor is used to search the user in AD. Currently the initgroups request only allows searches by name. With this patch a SID can be used as well. Resolves https://fedorahosted.org/sssd/ticket/2632 Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/tests/sysdb-tests.c')
-rw-r--r--src/tests/sysdb-tests.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tests/sysdb-tests.c b/src/tests/sysdb-tests.c
index a6c6b33de..e41fb0504 100644
--- a/src/tests/sysdb-tests.c
+++ b/src/tests/sysdb-tests.c
@@ -3580,6 +3580,10 @@ START_TEST(test_sysdb_get_real_name)
ret = sysdb_attrs_add_string(user_attrs, SYSDB_UPN, "foo@bar");
fail_unless(ret == EOK, "sysdb_attrs_add_string failed.");
+ ret = sysdb_attrs_add_string(user_attrs, SYSDB_SID_STR,
+ "S-1-5-21-123-456-789-111");
+ fail_unless(ret == EOK, "sysdb_attrs_add_string failed.");
+
ret = sysdb_store_user(test_ctx->domain, "RealName",
NULL, 22345, 0, "gecos",
"/home/realname", "/bin/bash",
@@ -3595,7 +3599,13 @@ START_TEST(test_sysdb_get_real_name)
ret = sysdb_get_real_name(test_ctx, test_ctx->domain, "foo@bar", &str);
fail_unless(ret == EOK, "sysdb_get_real_name failed.");
fail_unless(strcmp(str, "RealName") == 0, "Expected [%s], got [%s].",
- "foo@bar", str);
+ "RealName", str);
+
+ ret = sysdb_get_real_name(test_ctx, test_ctx->domain,
+ "S-1-5-21-123-456-789-111", &str);
+ fail_unless(ret == EOK, "sysdb_get_real_name failed.");
+ fail_unless(strcmp(str, "RealName") == 0, "Expected [%s], got [%s].",
+ "RealName", str);
}
END_TEST