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

bind() returns before binding operation is done #8

Open
whitlockjc opened this issue Nov 15, 2015 · 0 comments
Open

bind() returns before binding operation is done #8

whitlockjc opened this issue Nov 15, 2015 · 0 comments

Comments

@whitlockjc
Copy link
Owner

In function main, I had to insert sleep(3) between bind on line 533 and search_for_groups on line 541. Without this delay, the Active Directory server thinks the bind operation is still in progress, and search_for_groups throws an exception. This is arguably not the right way to handle it. Ideally, bind should poll for the completion of the operation and block until the operation finishes or times out.

Script is running under Windows XP.

Patch below to switch from bind to bind_s:

diff -r e3396390e99b sync_ldap_groups_to_svn_authz/sync_ldap_groups_to_svn_authz.py
--- a/sync_ldap_groups_to_svn_authz/sync_ldap_groups_to_svn_authz.py    Tue Jul 20 15:58:45 2010 -0600
+++ b/sync_ldap_groups_to_svn_authz/sync_ldap_groups_to_svn_authz.py    Wed Aug 29 02:01:39 2012 -0300
@@ -103,7 +103,7 @@

   ldapobject = ldap.initialize(url)

-  ldapobject.bind(bind_dn, bind_password)
+  ldapobject.bind_s(bind_dn, bind_password)

   if verbose:
     print("Successfully bound to %s..." % url)
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

1 participant