Skip to content

Issue 6566 - RI plugin failure to handle a modrdn for rename of member of multiple groups - #6567

Merged
jchapma merged 2 commits into
389ds:mainfrom
jchapma:ri-multi-group
Feb 4, 2025
Merged

jchapma merged 2 commits into
389ds:mainfrom
jchapma:ri-multi-group

Conversation

@jchapma

@jchapma jchapma commented Feb 3, 2025

Copy link
Copy Markdown
Contributor

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check if the new DN already exists in the attr being updated.

Fixes: #6566

Reviewed by:

…tiple groups

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups
fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check
if the new DN already exists in the attr being updated.

Fixes: 389ds#6566

Reviewed by:

@progier389 progier389 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tbordaz tbordaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the fix looks good to me I have a doubt.
The block deletes the value of the oldDN and add the value of the newDN.
In short the fix skips the block if the newDN value exists. I have a doubt about not removing the oldDN, I wonder if in some cases the oldDN may remain in the entry.
Would it be possible to catch LDAP_TYPE_OR_VALUE_EXISTS and XXX in _do_modify (where XXX is the RC when the modify does not find the value to delete)

slapi_log_err(SLAPI_LOG_PLUGIN, REFERINT_PLUGIN_SUBSYSTEM,
"_update_all_per_mod - Duplicate DN update detected, ignoring %s\n", newDN);
bv = (struct berval){0};
goto bail;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you need to call slapi_ch_free_string(&newDN) before going to 'bail'

@jchapma

jchapma commented Feb 4, 2025

Copy link
Copy Markdown
Contributor Author

Although the fix looks good to me I have a doubt. The block deletes the value of the oldDN and add the value of the newDN. In short the fix skips the block if the newDN value exists. I have a doubt about not removing the oldDN, I wonder if in some cases the oldDN may remain in the entry. Would it be possible to catch LDAP_TYPE_OR_VALUE_EXISTS and XXX in _do_modify (where XXX is the RC when the modify does not find the value to delete)

Yes, you are correct. With this change we are exiting before the delete of the oldDN is done. Let me change this.

@tbordaz tbordaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jchapma
jchapma merged commit 0b181ca into 389ds:main Feb 4, 2025
jchapma added a commit that referenced this pull request Feb 4, 2025
…r of multiple groups (#6567)

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups
fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check
if the new DN already exists in the attr being updated.

Fixes: #6566

Reviewed by: @progier389 , @tbordaz  (Thank you)
jchapma added a commit that referenced this pull request Feb 4, 2025
…r of multiple groups (#6567)

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups
fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check
if the new DN already exists in the attr being updated.

Fixes: #6566

Reviewed by: @progier389 , @tbordaz  (Thank you)
jchapma added a commit that referenced this pull request Feb 4, 2025
…r of multiple groups (#6567)

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups
fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check
if the new DN already exists in the attr being updated.

Fixes: #6566

Reviewed by: @progier389 , @tbordaz  (Thank you)
jchapma added a commit that referenced this pull request Feb 4, 2025
…r of multiple groups (#6567)

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups
fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check
if the new DN already exists in the attr being updated.

Fixes: #6566

Reviewed by: @progier389 , @tbordaz  (Thank you)
jchapma added a commit that referenced this pull request Feb 4, 2025
…r of multiple groups (#6567)

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups
fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check
if the new DN already exists in the attr being updated.

Fixes: #6566

Reviewed by: @progier389 , @tbordaz  (Thank you)
jchapma added a commit that referenced this pull request Feb 4, 2025
…r of multiple groups (#6567)

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups
fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check
if the new DN already exists in the attr being updated.

Fixes: #6566

Reviewed by: @progier389 , @tbordaz  (Thank you)
jchapma added a commit that referenced this pull request Feb 4, 2025
…r of multiple groups (#6567)

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups
fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check
if the new DN already exists in the attr being updated.

Fixes: #6566

Reviewed by: @progier389 , @tbordaz  (Thank you)
jchapma added a commit that referenced this pull request Feb 4, 2025
…r of multiple groups (#6567)

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups
fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check
if the new DN already exists in the attr being updated.

Fixes: #6566

Reviewed by: @progier389 , @tbordaz  (Thank you)
jchapma added a commit that referenced this pull request Feb 4, 2025
…r of multiple groups (#6567)

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups
fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check
if the new DN already exists in the attr being updated.

Fixes: #6566

Reviewed by: @progier389 , @tbordaz  (Thank you)
jchapma added a commit that referenced this pull request Feb 4, 2025
…r of multiple groups (#6567)

Bug description:
With AM and RI plugins enabled, the rename of a user that is part of multiple groups
fails with a "value exists" error.

Fix description:
For a modrdn the RI plugin creates a new DN, before a modify is attempted check
if the new DN already exists in the attr being updated.

Fixes: #6566

Reviewed by: @progier389 , @tbordaz  (Thank you)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RI plugin failure to handle a modrdn when user is in multiple groups

3 participants