Bug 2057063

Summary: Add support for recursively deleting subentries
Product: Red Hat Enterprise Linux 9 Reporter: mreynolds
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED ERRATA QA Contact: RHDS QE <ds-qe-bugs>
Severity: medium Docs Contact: David Voženílek <dvozenil>
Priority: high    
Version: 9.1CC: dvozenil, gfialova, gkimetto, ldap-maint, pasik, pcech, sgouvern
Target Milestone: rcKeywords: FutureFeature, Triaged
Target Release: 9.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: 389-ds-base-2.1.3-1.el9 Doc Type: Enhancement
Doc Text:
.Directory Server now supports recursive delete operations when using `ldapdelete` With this enhancement, Directory Server now supports the `Tree Delete Control [1.2.840.113556.1.4.805]` OpenLDAP control. As a result, you can use the `ldapdelete` utility to recursively delete subentries of a parent entry.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 10:30:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mreynolds 2022-02-22 16:36:33 UTC
Is your feature request related to a problem? Please describe.
If a parent entries contains any subentry object children there is no way to recursively delete such entry because neither the Subentries Control [1.3.6.1.4.1.4203.1.10.1] (used by OpenLDAP's ldapdelete) nor Tree Delete Control [1.2.840.113556.1.4.805] are supported and so the only resort is to delete such subentries first 1 by 1 before their parent entry can be deleted.

Describe the solution you'd like
Implementing support for Subentries Control [1.3.6.1.4.1.4203.1.10.1] as per RFC3676 should be pretty easy and straightforward and would allow OpenLDAP's ldapdelete pruning iteration to work properly.

Implementing support for Tree Delete Control [1.2.840.113556.1.4.805] as per draft-armijo-ldap-treedelete-02 is a bit more involved however it can be extremely useful for recursive delete operations on large subtrees mainly due to performance considerations.

Ideally it would be nice to have both implemented of course.

Describe alternatives you've considered
Currently the only alternative I know of is to grab the list of subentry objects DNs with ldapsearch and then feed them to ldapdelete with some slicing and dicing in between so those DNs are acceptable.

Comment 1 mreynolds 2022-02-22 16:37:41 UTC
Upstream ticket:

https://github.com/389ds/389-ds-base/issues/4970

Comment 17 errata-xmlrpc 2022-11-15 10:30:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: 389-ds-base security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:8162