Issue 9000 - memberOf value is lost when group DN is modified with only case change
Summary: memberOf value is lost when group DN is modified with only case change
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.47
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-27 16:39 UTC by Clément OUDOT
Modified: 2022-02-04 20:46 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Clément OUDOT 2019-03-27 16:39:14 UTC
Full_Name: Clement OUDOT
Version: 2.4.47
OS: GNU/Linux
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (81.250.130.213)


We use a very standard configuration with memberof overlay.

The issue is very easy to reproduce :
* Create a group with a user in an OpenLDAP server using memberof overlay
* The user should now have the group DN in memberOf attribute
* Rename the group to change its case, for example uppercase the first letter
* The group has be renamed but was removed form user memberOf attribute

The OpenLDAP log is the following:
5c9ba447 conn=1000 op=23 MODRDN
dn="cn=memberoftest,ou=groups,dc=example,dc=com"
5c9ba447 conn=1000 op=23: memberof_value_modify
DN="uid=coudot,ou=users,dc=example,dc=com" add
memberOf="cn=memberofTEST,ou=groups,dc=example,dc=com" failed err=20

Seems it is because memberof try to add the new value before deleting the old
one. As the values are the same when ignoring the case, the modification is
rejected.

I would say that doing the LDAP_SLIST_REMOVE before the LDAP_SLIST_INSERT_HEAD
in memberof.c should be enough but I don't know if this is safe.
Comment 1 Ondřej Kuzník 2019-06-05 13:30:24 UTC
On Wed, Mar 27, 2019 at 04:39:14PM +0000, clement.oudot@worteks.com wrote:
> Seems it is because memberof try to add the new value before deleting the old
> one. As the values are the same when ignoring the case, the modification is
> rejected.
> 
> I would say that doing the LDAP_SLIST_REMOVE before the LDAP_SLIST_INSERT_HEAD
> in memberof.c should be enough but I don't know if this is safe.

Alternatively checking that the new DN is not equivalent to the old and
if so, noop it? That's just been uploaded to
https://github.com/mistotebe/openldap/tree/its9000

Regards,

-- 
Ondřej Kuzník
Senior Software Engineer
Symas Corporation                       http://www.symas.com
Packaged, certified, and supported LDAP solutions powered by OpenLDAP

Comment 2 Clément OUDOT 2019-06-05 13:35:53 UTC
Le 05/06/2019 à 15:30, ondra@mistotebe.net a écrit :
> On Wed, Mar 27, 2019 at 04:39:14PM +0000, clement.oudot@worteks.com wrote:
>> Seems it is because memberof try to add the new value before deleting the old
>> one. As the values are the same when ignoring the case, the modification is
>> rejected.
>>
>> I would say that doing the LDAP_SLIST_REMOVE before the LDAP_SLIST_INSERT_HEAD
>> in memberof.c should be enough but I don't know if this is safe.
> Alternatively checking that the new DN is not equivalent to the old and
> if so, noop it? That's just been uploaded to
> https://github.com/mistotebe/openldap/tree/its9000


Seems indeed a better solution!


-- 
Clément Oudot | Identity Solutions Manager

clement.oudot@worteks.com

Worteks | https://www.worteks.com


Comment 3 Quanah Gibson-Mount 2019-06-13 18:52:43 UTC
changed notes
Comment 4 Quanah Gibson-Mount 2019-06-20 17:46:16 UTC
changed notes
changed state Open to Release
moved from Incoming to Software Bugs
Comment 5 OpenLDAP project 2019-07-24 19:05:14 UTC
Fixed in master
Fixed in RE24 (2.4.48)
Comment 6 Quanah Gibson-Mount 2019-07-24 19:05:14 UTC
changed notes
changed state Release to Closed
Comment 7 sebastien.chaumat 2022-02-04 11:39:26 UTC
This bug is still present in 2.4.49 (ubuntu).
Comment 8 Quanah Gibson-Mount 2022-02-04 20:46:16 UTC
(In reply to sebastien.chaumat from comment #7)
> This bug is still present in 2.4.49 (ubuntu).

The OpenLDAP 2.4 series is historic and out of support.

The memberof overlay is deprecated in OpenLDAP 2.5 and later and the dynlist overlay should be used to provide memberOf support.