Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete_tree when the server doesn't support the DELETE_TREE control code. #267

Closed
duffyjp opened this issue Apr 1, 2016 · 4 comments
Closed

Comments

@duffyjp
Copy link
Contributor

duffyjp commented Apr 1, 2016

I'm trying to use delete_tree to remove an entire OU and all subordinate objects that may be there.

When I try I get subordinate objects must be deleted first
The only difference between delete and delete_tree is that delete_tree adds the control code 1.2.840.113556.1.4.805 to the delete request. That's all fine, but my server apparently doesn't include that code.

I'm thinking the delete_tree method should conditionally use DELETE_TREE if the server includes it in it's :supportedcontrol array, and if not it should manually recurse the tree deleting everything. If I do ldapdelete -r blah blah from the commandline I'm able to do what I'm attempting with Net::LDAP's delete_tree, so I know it's possible.

Does this sound like a good idea? I'd rather build this feature into a Pull request than code it into my specific application.

@jch
Copy link
Member

jch commented Apr 4, 2016

That sounds reasonable to me. Have you looked at any other LDAP clients in other languages to see whether they do something similar? What server are you using? I'm curious whether 1.2.840.113556.1.4.805 is commonly implemented.

@jch
Copy link
Member

jch commented Apr 4, 2016

An interim solution would be to raise an error in delete_tree if the control code is not supported. This would make the interface less misleading.

@duffyjp
Copy link
Contributor Author

duffyjp commented Apr 7, 2016

Here's a link to the PR: #268

@HarlemSquirrel
Copy link
Member

Closed by #268

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

No branches or pull requests

3 participants