#51224 Issue 51222 - It should not be allowed to delete Managed Entry manually
Closed by spichugi. Opened by spichugi.
spichugi/389-ds-base i51222  into  master

Download 51224.patch

Bug Description: It is possible to delete a managed entry and no error is raised.
Also, while doing delete or modrdn peration on a managing entry and the managed entry
doesn't exist, we should continue the operation.

Fix Description: We should put an entry struct duplicate to SLAPI_ENTRY_PRE_OP pblock
before we execute plugins PRE_OP. Also, we should allow to continue modrdn and delete
managing entry operations execution even when managed entry doesn't exists.
Allow 'cn=directory manager' to delete managed entry on direct update.

https://pagure.io/389-ds-base/issue/51222

Reviewed by: ?

Minor, but should be =NULL here as good practice.

Is there an associated test case with this?

Besides all this, the C looks good :)

The patch keeps a copy of the entry before calling betxn_preop. Is it required with your fix or is it for code cleanup ?

rebased onto 8dd5685e76099dc394859ab71f66166fe213d4d5

rebased onto 097f8876a3b030605fe05e2123ed1543c150bdaa

Minor, but should be =NULL here as good practice.

Done

The patch keeps a copy of the entry before calling betxn_preop. Is it required with your fix or is it for code cleanup ?

Both :) I've made it consistent with other ldbm functions (i.e. https://pagure.io/389-ds-base/blob/master/f/ldap/servers/slapd/back-ldbm/ldbm_modify.c#_729 is before betxn_preop)

And it was the cause of the failure because we use the entry in MEP preop - https://pagure.io/389-ds-base/blob/master/f/ldap/servers/plugins/mep/mep.c#_2168

Also, I've added a test - please, check.

shouldn't it be 'managed_groups_user_conn.get(managed_entry.rdn)'

rebased onto 594bf91f6b182e2b8d053109e330a8ccb67f395b

shouldn't it be 'managed_groups_user_conn.get(managed_entry.rdn)'

Fixed. Please, check.

The patch looks good to me. ACK

Pull-Request has been merged by spichugi

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/4277

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

Metadata