Added private recursive_delete as alternative to DELETE_TREE#268
Merged
HarlemSquirrel merged 1 commit intoruby-ldap:masterfrom Aug 18, 2020
Merged
Added private recursive_delete as alternative to DELETE_TREE#268HarlemSquirrel merged 1 commit intoruby-ldap:masterfrom
HarlemSquirrel merged 1 commit intoruby-ldap:masterfrom
Conversation
…ers that don't support it.
Contributor
Author
|
I tracked down the source code for "ldapdelete" and it looks like that always does a recursive delete, rather than using the control code. I see no reason not to use DELETE_TREE if it's available though. https://opensource.apple.com/source/OpenLDAP/OpenLDAP-208.5/OpenLDAP/clients/tools/ldapdelete.c Here's an interesting chunk. If you pass /* If prune is on, remove a whole subtree. Delete the children of the
* DN recursively, then the DN requested.
*/
if ( prune ) {
retry:;
deletechildren( ld, dn, subentries );
}
rc = ldap_delete_ext( ld, dn, NULL, NULL, &id ); |
Member
HarlemSquirrel
left a comment
There was a problem hiding this comment.
This looks great! Would you be able to write a test for this?
HarlemSquirrel
approved these changes
Aug 18, 2020
Member
HarlemSquirrel
left a comment
There was a problem hiding this comment.
I've got a test for this ready. It looks like OpenLDAP doesn't support the delete tree control and we didn't have a test for this.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
delete_treechecks if you LDAP server supports the DELETE_TREE control code and then either uses it, or recursively deletes instead-- to the same effect.