server/sources/ldapfeed.py
changeset 9468 39b7a91a3f4c
parent 9462 375fc1868b11
child 9512 88dc96fc9fc1
equal deleted inserted replaced
9467:ad66d7b3fd48 9468:39b7a91a3f4c
   273         except ldap.LDAPError: # Invalid protocol version, fall back safely
   273         except ldap.LDAPError: # Invalid protocol version, fall back safely
   274             conn.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION2)
   274             conn.set_option(ldap.OPT_PROTOCOL_VERSION, ldap.VERSION2)
   275         # Deny auto-chasing of referrals to be safe, we handle them instead
   275         # Deny auto-chasing of referrals to be safe, we handle them instead
   276         # Required for AD
   276         # Required for AD
   277         try:
   277         try:
   278            conn.set_option(ldap.OPT_REFERRALS, 0)
   278             conn.set_option(ldap.OPT_REFERRALS, 0)
   279         except ldap.LDAPError: # Cannot set referrals, so do nothing
   279         except ldap.LDAPError: # Cannot set referrals, so do nothing
   280            pass
   280             pass
   281         #conn.set_option(ldap.OPT_NETWORK_TIMEOUT, conn_timeout)
   281         #conn.set_option(ldap.OPT_NETWORK_TIMEOUT, conn_timeout)
   282         #conn.timeout = op_timeout
   282         #conn.timeout = op_timeout
   283         # Now bind with the credentials given. Let exceptions propagate out.
   283         # Now bind with the credentials given. Let exceptions propagate out.
   284         if user is None:
   284         if user is None:
   285             # XXX always use simple bind for data connection
   285             # XXX always use simple bind for data connection