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

Anonymous bind not possible #3

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

Anonymous bind not possible #3

whitlockjc opened this issue Nov 15, 2015 · 0 comments

Comments

@whitlockjc
Copy link
Owner

Currently, the bind-dn is required which disallows anonymous binds. The attached patch adds support for anonymous binding by not passing a bind-dn:

Index: sync_ldap_groups_to_svn_authz.py
===================================================================
--- sync_ldap_groups_to_svn_authz.py    (revision 25)
+++ sync_ldap_groups_to_svn_authz.py    (revision 26)
@@ -103,7 +103,10 @@

   ldapobject = ldap.initialize(url)

-  ldapobject.bind(bind_dn, bind_password)
+  if (bind_dn != None):
+    ldapobject.bind(bind_dn, bind_password)
+  else:
+    ldapobject.simple_bind_s('', '')

   if verbose:
     print("Successfully bound to %s..." % url)
@@ -467,8 +470,8 @@
 def are_properties_set():
   """This function will perform a simple test to make sure none of the
 properties are 'None'."""
-  if (bind_dn == None):
-    return False
+  #if (bind_dn == None):
+  #  return False
   if (url == None):
     return False
   if (base_dn == None):
@@ -493,8 +496,8 @@
   """This function returns a list of unset properties necessary to run."""
   unset_properties = []

-  if (bind_dn == None):
-    unset_properties += ['bind-dn']
+  #if (bind_dn == None):
+  #  unset_properties += ['bind-dn']
   if (url == None):
     unset_properties += ['url']
   if (base_dn == None):
@@ -535,7 +538,7 @@
   # Allow user to type in password if missing
   global bind_password

-  if bind_password == None:
+  if bind_dn != None and bind_password == None:
     bind_password = getpass.getpass("Please provide the bind DN password: ")

   ldapobject = None
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