summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Židek <mzidek@redhat.com>2016-11-10 15:04:57 +0100
committerJakub Hrozek <jhrozek@redhat.com>2016-11-14 15:13:28 +0100
commit9c4c3a204e1631f61378982d39cdba0ce25ee262 (patch)
tree0d0d942797abf711d521c7d94e40b450860c73be
parentefba0221c407af832727da26fa45c7aa326c89b9 (diff)
downloadsssd-9c4c3a204e1631f61378982d39cdba0ce25ee262.tar.gz
sssd-9c4c3a204e1631f61378982d39cdba0ce25ee262.tar.xz
sssd-9c4c3a204e1631f61378982d39cdba0ce25ee262.zip
ipa: Nested netgroups do not work
We lowercase the keys to the hash table used to store netgroups but do not lowercase it when reading the table. This results in nested netgroups not being found when they should and the processing fails. The lowercasing does not seem to be necessary anymore (not sure if it ever was) so we can skip it. Resolves: https://fedorahosted.org/sssd/ticket/3159 Reviewed-by: Petr Cech <pcech@redhat.com> (cherry picked from commit ff565da1011aa4312847e28e7af66e57fccf8b90) (cherry picked from commit 7de33877c7e39f9a5cae6baf815dc18ae5a18597)
-rw-r--r--src/providers/ipa/ipa_netgroups.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/providers/ipa/ipa_netgroups.c b/src/providers/ipa/ipa_netgroups.c
index a19e5e03d..17b11af5d 100644
--- a/src/providers/ipa/ipa_netgroups.c
+++ b/src/providers/ipa/ipa_netgroups.c
@@ -563,7 +563,6 @@ static void ipa_netgr_members_process(struct tevent_req *subreq)
size_t count;
int ret, i;
const char *orig_dn;
- char *orig_dn_lower;
hash_table_t *table;
hash_key_t key;
hash_value_t value;
@@ -638,20 +637,12 @@ static void ipa_netgr_members_process(struct tevent_req *subreq)
goto fail;
}
- orig_dn_lower = talloc_strdup(table, orig_dn);
- if (orig_dn_lower == NULL) {
+ key.str = talloc_strdup(table, orig_dn);
+ if (key.str == NULL) {
ret = ENOMEM;
goto fail;
}
- /* Transform the DN to lower case.
- * this is important, as the member/memberof attributes
- * have the value also in lower-case
- */
- key.str = orig_dn_lower;
- while (*orig_dn_lower != '\0') {
- *orig_dn_lower = tolower(*orig_dn_lower);
- orig_dn_lower++;
- }
+
value.ptr = entities[i];
ret = hash_enter(table, &key, &value);
if (ret != HASH_SUCCESS) {