Score:0

Does ldapmodify propagate changes of dn/uid to associated groups of the user?

ee flag

I have to modify a user's UID and DN in an OpenLDAP server because of marriage. Now, I follow this example from Oracle's website: https://docs.oracle.com/cd/E22289_01/html/821-1273/adding-modifying-and-deleting-directory-data.html (under the headline "To change an RDN").

However, the user is right now associated with several LDAP groups via her UID or DN. Will ldapmodify actually change the UID/DN in these associated groups as well or will that have to be done manually by the administrator after the renaming of the user itself?

Thanks for any help!

Score:0
la flag

I have to modify a user's UID and DN in an OpenLDAP server because of marriage

Maybe it's too late already, but you typically try to decide beforehand on a account naming convention where people getting married, divorced, re-married only requires adjusting their "Display Name" and/or other name related attributes (and possibly setting up an additional and new default e-mail alias) rather than each change in marital status and preferred salutation requiring new logon names, moving mailboxes and home directories and updating group and mailing list memberships.

( Our joiners for example get assigned an random unique and un-used 6 digit employee number and their account/login/samAccount Name will be usr123456 based that employee number which will be with them forever. That is also used for their DN and entries look like:

dn: uid=usr123456,ou=People,dc=example,dc=com
cn: Marcia Garza
sn: Garza
givenName: Marcia

)

Will ldapmodify actually change the UID/DN in these associated groups

That depends ...

  • The ldapmodify command itself doesn't do any sanity checks and will only scope the DN and attributes that you specify. If sanity checks need to happen they will have to be done in the backend by the OpenLDAP server or by you as the sysadmin.

  • When your directory is configured with the "referential integrity" overlay then YES:

    Whenever a modrdn or delete is performed, that is, when an entry's DN is renamed or an entry is removed, the server will search the directory for references to this DN (in selected attributes: see below) and update them accordingly. If it was a delete operation, the reference is deleted. If it was a modrdn operation, then the reference is updated with the new DN.

  • When you don't have that overlay enabled, things might still remain sane automatically when you're using OpenLdap's dynamic lists overlay for all your groups.

    Then list of member DN's that belong to a group are not hard-coded but generated automatically based on the MemberOf attribute set on the members DN. When that members DN is renamed, the new DN will automatically show up as the member: in the group and the old DN will have disappeared.

Otherwise: no, after changing the DN your groups will contain a member DN that no longer exists and your renamed user will lose access and privileges. You will need to manually update everywhere where the old DN was used.


Note that when renaming a DN the LDAP function takes a deleteoldrdn parameter which is used as a boolean value to indicate whether the old RDN values should be deleted from the entry or not. When set to false the entry can still be found by the old DN and you won't end up with broken references.

heeeresjohnny avatar
ee flag
Thanks a lot for the detailed answer! I think that the username convention you suggested is a good idea to keep the username independent from any name changes of individual people. Sadly, I inherited the entire stack including the LDAP from my predecessor and all usernames are currently "firstname.lastname" with the requirement to change them on a person's name change. I'm not sure, yet, which (if any) overlays are present on the LDAP, but I'll check before I do any changes. Otherwise, would it also work to just "ldapvi" and search/replace all occurrences of the name with the new one?
diya avatar
la flag
Although that would be somewhat cumbersome, when it needs to happen, it needs to happen and you can manually search and replace every occurrence of the old DN
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.