]>
Commit | Line | Data |
---|---|---|
92ae11e3 SS |
1 | From 9ccd49a3bcabd8eb32a559af2cacf2b0fdcfad96 Mon Sep 17 00:00:00 2001 |
2 | From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek@redhat.com> | |
3 | Date: Thu, 10 Nov 2016 15:04:57 +0100 | |
4 | Subject: [PATCH 27/39] ipa: Nested netgroups do not work | |
5 | ||
6 | We lowercase the keys to the hash table used to store netgroups | |
7 | but do not lowercase it when reading the table. This results | |
8 | in nested netgroups not being found when they should and | |
9 | the processing fails. | |
10 | ||
11 | The lowercasing does not seem to be necessary anymore (not | |
12 | sure if it ever was) so we can skip it. | |
13 | ||
14 | Resolves: | |
15 | https://fedorahosted.org/sssd/ticket/3159 | |
16 | ||
17 | Reviewed-by: Petr Cech <pcech@redhat.com> | |
18 | (cherry picked from commit ff565da1011aa4312847e28e7af66e57fccf8b90) | |
19 | (cherry picked from commit 7de33877c7e39f9a5cae6baf815dc18ae5a18597) | |
20 | --- | |
21 | src/providers/ipa/ipa_netgroups.c | 15 +++------------ | |
22 | 1 file changed, 3 insertions(+), 12 deletions(-) | |
23 | ||
24 | diff --git a/src/providers/ipa/ipa_netgroups.c b/src/providers/ipa/ipa_netgroups.c | |
25 | index a19e5e03d..17b11af5d 100644 | |
26 | --- a/src/providers/ipa/ipa_netgroups.c | |
27 | +++ b/src/providers/ipa/ipa_netgroups.c | |
28 | @@ -563,7 +563,6 @@ static void ipa_netgr_members_process(struct tevent_req *subreq) | |
29 | size_t count; | |
30 | int ret, i; | |
31 | const char *orig_dn; | |
32 | - char *orig_dn_lower; | |
33 | hash_table_t *table; | |
34 | hash_key_t key; | |
35 | hash_value_t value; | |
36 | @@ -638,20 +637,12 @@ static void ipa_netgr_members_process(struct tevent_req *subreq) | |
37 | goto fail; | |
38 | } | |
39 | ||
40 | - orig_dn_lower = talloc_strdup(table, orig_dn); | |
41 | - if (orig_dn_lower == NULL) { | |
42 | + key.str = talloc_strdup(table, orig_dn); | |
43 | + if (key.str == NULL) { | |
44 | ret = ENOMEM; | |
45 | goto fail; | |
46 | } | |
47 | - /* Transform the DN to lower case. | |
48 | - * this is important, as the member/memberof attributes | |
49 | - * have the value also in lower-case | |
50 | - */ | |
51 | - key.str = orig_dn_lower; | |
52 | - while (*orig_dn_lower != '\0') { | |
53 | - *orig_dn_lower = tolower(*orig_dn_lower); | |
54 | - orig_dn_lower++; | |
55 | - } | |
56 | + | |
57 | value.ptr = entities[i]; | |
58 | ret = hash_enter(table, &key, &value); | |
59 | if (ret != HASH_SUCCESS) { | |
60 | -- | |
61 | 2.11.0 | |
62 |