From 71e9d46ae495ed7e7132007b94e67690a8e65759 Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 12:37:39 +0000 Subject: [PATCH 01/14] Updated release and copyright --- Doc/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/conf.py b/Doc/conf.py index 32babb6..51fb9d5 100644 --- a/Doc/conf.py +++ b/Doc/conf.py @@ -11,7 +11,7 @@ # All configuration values have a default value; values that are commented out # serve to show the default value. # -# $Id: conf.py,v 1.21 2015/06/05 21:05:37 stroeder Exp $ +# $Id: conf.py,v 1.22 2015/10/24 12:37:39 stroeder Exp $ import sys @@ -36,7 +36,7 @@ master_doc = 'index' # General substitutions. project = 'python-ldap' -copyright = '2008-2014, python-ldap project team' +copyright = '2008-2015, python-ldap project team' # The default replacements for |version| and |release|, also used in various # other places throughout the built documents. @@ -44,7 +44,7 @@ copyright = '2008-2014, python-ldap project team' # The short X.Y version. version = '2.4' # The full version, including alpha/beta/rc tags. -release = '2.4.20.0' +release = '2.4.21.0' # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: From abef0bb5f3f4cbade4a0f64102c85018110a15f9 Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 12:49:41 +0000 Subject: [PATCH 02/14] Added stub for ldap.sasl --- Doc/index.rst | 3 ++- Doc/ldap-sasl.rst | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 Doc/ldap-sasl.rst diff --git a/Doc/index.rst b/Doc/index.rst index ad86059..2338eb2 100644 --- a/Doc/index.rst +++ b/Doc/index.rst @@ -2,7 +2,7 @@ python-ldap Documentation ########################## -.. % $Id: index.rst,v 1.8 2011/10/26 19:42:45 stroeder Exp $ +.. % $Id: index.rst,v 1.9 2015/10/24 12:49:41 stroeder Exp $ .. topic:: Abstract @@ -30,6 +30,7 @@ Contents ldap-resiter.rst ldap-schema.rst ldap-syncrepl.rst + ldap-sasl.rst ldif.rst ldapurl.rst dsml.rst diff --git a/Doc/ldap-sasl.rst b/Doc/ldap-sasl.rst new file mode 100644 index 0000000..dd5fce3 --- /dev/null +++ b/Doc/ldap-sasl.rst @@ -0,0 +1,69 @@ +.. % $Id: ldap-sasl.rst,v 1.1 2015/10/24 12:49:41 stroeder Exp $ + + +******************************************** +:py:mod:`ldap.sasl` Handling LDAPv3 schema +******************************************** + +.. py:module:: ldap.sasl + +This module implements various authentication methods for SASL bind. + +.. seealso:: + + :rfc:`4422` - Simple Authentication and Security Layer (SASL) + + +:py:mod:`ldap.sasl` SASL bind requests +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. py:module:: ldap.sasl + + +.. py:data:: CB_USER + +.. py:data:: CB_AUTHNAME + +.. py:data:: CB_LANGUAGE + +.. py:data:: CB_PASS + +.. py:data:: CB_ECHOPROMPT + +.. py:data:: CB_NOECHOPROMPT + +.. py:data:: CB_GETREALM + + +Functions +========= + +.. autofunction:: ldap.sasl.subentry.urlfetch + +Classes +======= + +.. autoclass:: ldap.sasl.sasl + :members: + +.. autoclass:: ldap.sasl.cram_md5 + :members: + +.. autoclass:: ldap.sasl.digest_md5 + :members: + +.. autoclass:: ldap.sasl.gssapi + :members: + +.. autoclass:: ldap.sasl.external + :members: + + +.. _ldap.sasl-example: + +Examples for ldap.sasl +^^^^^^^^^^^^^^^^^^^^^^^^ + +:: + + import ldap.sasl From c50d6942470340c46fb08684a948b07f4ac919f6 Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 13:07:33 +0000 Subject: [PATCH 03/14] Added example and link to RFC 4513 --- Doc/ldap-sasl.rst | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Doc/ldap-sasl.rst b/Doc/ldap-sasl.rst index dd5fce3..2cd5fc6 100644 --- a/Doc/ldap-sasl.rst +++ b/Doc/ldap-sasl.rst @@ -1,4 +1,4 @@ -.. % $Id: ldap-sasl.rst,v 1.1 2015/10/24 12:49:41 stroeder Exp $ +.. % $Id: ldap-sasl.rst,v 1.2 2015/10/24 13:07:33 stroeder Exp $ ******************************************** @@ -12,6 +12,7 @@ This module implements various authentication methods for SASL bind. .. seealso:: :rfc:`4422` - Simple Authentication and Security Layer (SASL) + :rfc:`4513` - Lightweight Directory Access Protocol (LDAP): Authentication Methods and Security Mechanisms :py:mod:`ldap.sasl` SASL bind requests @@ -64,6 +65,21 @@ Classes Examples for ldap.sasl ^^^^^^^^^^^^^^^^^^^^^^^^ +This example connects to a OpenLDAP server via LDAP over IPC and +sends a SASL external bind request. + :: - import ldap.sasl + import ldap, ldap.sasl, urllib + + ldapi_path = '/tmp/openldap-socket' + ldap_conn = ldap.initialize( + 'ldapi://%s' % ( + urllib.quote_plus(ldapi_path) + ) + ) + # Send SASL bind request for mechanism EXTERNAL + ldap_conn.sasl_non_interactive_bind_s('EXTERNAL') + # Find out the SASL Authorization Identity + print ldap_conn.whoami_s() + From 5abe88935f51c6404ec694b27ad5ffbbdb6d09dd Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 13:41:02 +0000 Subject: [PATCH 04/14] Removed functions section and link to draft-chu-ldap-ldapi --- Doc/ldap-sasl.rst | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/Doc/ldap-sasl.rst b/Doc/ldap-sasl.rst index 2cd5fc6..c91b49a 100644 --- a/Doc/ldap-sasl.rst +++ b/Doc/ldap-sasl.rst @@ -1,4 +1,4 @@ -.. % $Id: ldap-sasl.rst,v 1.2 2015/10/24 13:07:33 stroeder Exp $ +.. % $Id: ldap-sasl.rst,v 1.3 2015/10/24 13:41:02 stroeder Exp $ ******************************************** @@ -15,11 +15,8 @@ This module implements various authentication methods for SASL bind. :rfc:`4513` - Lightweight Directory Access Protocol (LDAP): Authentication Methods and Security Mechanisms -:py:mod:`ldap.sasl` SASL bind requests -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -.. py:module:: ldap.sasl - +Constants +========= .. py:data:: CB_USER @@ -36,11 +33,6 @@ This module implements various authentication methods for SASL bind. .. py:data:: CB_GETREALM -Functions -========= - -.. autofunction:: ldap.sasl.subentry.urlfetch - Classes ======= @@ -65,8 +57,9 @@ Classes Examples for ldap.sasl ^^^^^^^^^^^^^^^^^^^^^^^^ -This example connects to a OpenLDAP server via LDAP over IPC and -sends a SASL external bind request. +This example connects to an OpenLDAP server via LDAP over IPC +(see `draft-chu-ldap-ldapi `_) +and sends a SASL external bind request. :: From 51ed53505d6f6e92ce0fd422d6024ba2ea34683e Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 15:27:03 +0000 Subject: [PATCH 05/14] Started missing docs for sub-module ldap.sasl. --- CHANGES | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index a5540e5..e763ef1 100644 --- a/CHANGES +++ b/CHANGES @@ -7,6 +7,9 @@ Lib/ * LDIFParser now also accepts value-spec without a space after the colon. +Doc/ +* Started missing docs for sub-module ldap.sasl. + ---------------------------------------------------------------- Released 2.4.21 2015-09-25 @@ -1204,4 +1207,4 @@ Released 2.0.0pre02 2002-02-01 ---------------------------------------------------------------- Released 1.10alpha3 2000-09-19 -$Id: CHANGES,v 1.358 2015/09/30 17:17:28 stroeder Exp $ +$Id: CHANGES,v 1.359 2015/10/24 15:27:03 stroeder Exp $ From 2cc6d1102bf91420640477d50f65b8526453752e Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 15:42:41 +0000 Subject: [PATCH 06/14] Added key-word argument authz_id to LDAPObject methods sasl_non_interactive_bind_s(), sasl_external_bind_s() and sasl_gssapi_bind_s(). --- CHANGES | 5 ++++- Lib/ldap/ldapobject.py | 20 +++++++++++++------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index e763ef1..f8cffaf 100644 --- a/CHANGES +++ b/CHANGES @@ -6,6 +6,9 @@ Changes since 2.4.21: Lib/ * LDIFParser now also accepts value-spec without a space after the colon. +* Added key-word argument authz_id to LDAPObject methods + sasl_non_interactive_bind_s(), sasl_external_bind_s() and + sasl_gssapi_bind_s() Doc/ * Started missing docs for sub-module ldap.sasl. @@ -1207,4 +1210,4 @@ Released 2.0.0pre02 2002-02-01 ---------------------------------------------------------------- Released 1.10alpha3 2000-09-19 -$Id: CHANGES,v 1.359 2015/10/24 15:27:03 stroeder Exp $ +$Id: CHANGES,v 1.360 2015/10/24 15:42:41 stroeder Exp $ diff --git a/Lib/ldap/ldapobject.py b/Lib/ldap/ldapobject.py index c807973..39f0f75 100644 --- a/Lib/ldap/ldapobject.py +++ b/Lib/ldap/ldapobject.py @@ -3,7 +3,7 @@ ldapobject.py - wraps class _ldap.LDAPObject See http://www.python-ldap.org/ for details. -\$Id: ldapobject.py,v 1.147 2015/08/08 13:37:41 stroeder Exp $ +\$Id: ldapobject.py,v 1.148 2015/10/24 15:42:41 stroeder Exp $ Compability: - Tested with Python 2.0+ but should work with Python 1.5.x @@ -243,23 +243,29 @@ class SimpleLDAPObject: """ return self._ldap_call(self._l.sasl_interactive_bind_s,who,auth,RequestControlTuples(serverctrls),RequestControlTuples(clientctrls),sasl_flags) - def sasl_non_interactive_bind_s(self,sasl_mech,serverctrls=None,clientctrls=None,sasl_flags=ldap.SASL_QUIET): + def sasl_non_interactive_bind_s(self,sasl_mech,serverctrls=None,clientctrls=None,sasl_flags=ldap.SASL_QUIET,authz_id=''): """ Send a SASL bind request using a non-interactive SASL method (e.g. GSSAPI, EXTERNAL) """ - self.sasl_interactive_bind_s('',ldap.sasl.sasl({},sasl_mech)) + self.sasl_interactive_bind_s( + '', + ldap.sasl.sasl( + {ldap.sasl.CB_USER:authz_id}, + sasl_mech + ) + ) - def sasl_external_bind_s(self,serverctrls=None,clientctrls=None,sasl_flags=ldap.SASL_QUIET): + def sasl_external_bind_s(self,serverctrls=None,clientctrls=None,sasl_flags=ldap.SASL_QUIET,authz_id=''): """ Send SASL bind request using SASL mech EXTERNAL """ - self.sasl_non_interactive_bind_s('EXTERNAL',serverctrls,clientctrls,sasl_flags) + self.sasl_non_interactive_bind_s('EXTERNAL',serverctrls,clientctrls,sasl_flags,authz_id) - def sasl_gssapi_bind_s(self,serverctrls=None,clientctrls=None,sasl_flags=ldap.SASL_QUIET): + def sasl_gssapi_bind_s(self,serverctrls=None,clientctrls=None,sasl_flags=ldap.SASL_QUIET,authz_id=''): """ Send SASL bind request using SASL mech GSSAPI """ - self.sasl_non_interactive_bind_s('GSSAPI',serverctrls,clientctrls,sasl_flags) + self.sasl_non_interactive_bind_s('GSSAPI',serverctrls,clientctrls,sasl_flags,authz_id) def sasl_bind_s(self,dn,mechanism,cred,serverctrls=None,clientctrls=None): """ From 12cf5911e0ce6d42567587ae4176694ae6813453 Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 15:46:12 +0000 Subject: [PATCH 07/14] ReconnectLDAPObject.sasl_bind_s() now correctly uses generic wrapper arguments *args,**kwargs --- CHANGES | 5 ++++- Lib/ldap/ldapobject.py | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index f8cffaf..575252a 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,9 @@ Lib/ * Added key-word argument authz_id to LDAPObject methods sasl_non_interactive_bind_s(), sasl_external_bind_s() and sasl_gssapi_bind_s() +* Hmmpf! Added missing self to LDAPObject.fileno(). +* ReconnectLDAPObject.sasl_bind_s() now correctly uses + generic wrapper arguments *args,**kwargs Doc/ * Started missing docs for sub-module ldap.sasl. @@ -1210,4 +1213,4 @@ Released 2.0.0pre02 2002-02-01 ---------------------------------------------------------------- Released 1.10alpha3 2000-09-19 -$Id: CHANGES,v 1.360 2015/10/24 15:42:41 stroeder Exp $ +$Id: CHANGES,v 1.361 2015/10/24 15:46:12 stroeder Exp $ diff --git a/Lib/ldap/ldapobject.py b/Lib/ldap/ldapobject.py index 39f0f75..8205bd4 100644 --- a/Lib/ldap/ldapobject.py +++ b/Lib/ldap/ldapobject.py @@ -3,7 +3,7 @@ ldapobject.py - wraps class _ldap.LDAPObject See http://www.python-ldap.org/ for details. -\$Id: ldapobject.py,v 1.148 2015/10/24 15:42:41 stroeder Exp $ +\$Id: ldapobject.py,v 1.149 2015/10/24 15:46:12 stroeder Exp $ Compability: - Tested with Python 2.0+ but should work with Python 1.5.x @@ -136,7 +136,7 @@ class SimpleLDAPObject: self.__class__.__name__,repr(name) ) - def fileno(): + def fileno(self): """ Returns file description of LDAP connection. @@ -933,7 +933,7 @@ class ReconnectLDAPObject(SimpleLDAPObject): self._store_last_bind(SimpleLDAPObject.sasl_interactive_bind_s,*args,**kwargs) return res - def sasl_bind_s(self,dn,mechanism,cred,serverctrls=None,clientctrls=None): + def sasl_bind_s(self,*args,**kwargs): res = self._apply_method_s(SimpleLDAPObject.sasl_bind_s,*args,**kwargs) self._store_last_bind(SimpleLDAPObject.sasl_bind_s,*args,**kwargs) return res From 0fa88d045e2406ac505db39fd2f655f52e1be404 Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 15:50:00 +0000 Subject: [PATCH 08/14] LDIFParser.parse_change_records() now correctly calls handle_change_modify() --- CHANGES | 6 ++++-- Lib/ldif.py | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index 575252a..6f2301f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,5 @@ ---------------------------------------------------------------- -Released 2.4.22 2015-10-xx +Released 2.4.22 2015-10-25 Changes since 2.4.21: @@ -12,6 +12,8 @@ Lib/ * Hmmpf! Added missing self to LDAPObject.fileno(). * ReconnectLDAPObject.sasl_bind_s() now correctly uses generic wrapper arguments *args,**kwargs +* LDIFParser.parse_change_records() now correctly calls + LDIFParser.handle_change_modify() Doc/ * Started missing docs for sub-module ldap.sasl. @@ -1213,4 +1215,4 @@ Released 2.0.0pre02 2002-02-01 ---------------------------------------------------------------- Released 1.10alpha3 2000-09-19 -$Id: CHANGES,v 1.361 2015/10/24 15:46:12 stroeder Exp $ +$Id: CHANGES,v 1.362 2015/10/24 15:50:00 stroeder Exp $ diff --git a/Lib/ldif.py b/Lib/ldif.py index 47df877..7466020 100644 --- a/Lib/ldif.py +++ b/Lib/ldif.py @@ -3,7 +3,7 @@ ldif - generate and parse LDIF data (see RFC 2849) See http://www.python-ldap.org/ for details. -$Id: ldif.py,v 1.85 2015/09/30 17:17:28 stroeder Exp $ +$Id: ldif.py,v 1.86 2015/10/24 15:50:00 stroeder Exp $ Python compability note: Tested with Python 2.0+, but should work with Python 1.5.2+. @@ -467,7 +467,7 @@ class LDIFParser: if modops: # append entry to result list - self.handle_modify(dn,modops,controls) + self.handle_change_modify(dn,modops,controls) else: From c9f34d54556d82a49805be1e4e24e2f8e881cdfc Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 15:52:23 +0000 Subject: [PATCH 09/14] Undefined variable name 'SSSVLVPagedLDAPObject' in __all__ (undefined-all-variable) --- Lib/ldap/controls/sss.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Lib/ldap/controls/sss.py b/Lib/ldap/controls/sss.py index 406fb0b..95f751e 100644 --- a/Lib/ldap/controls/sss.py +++ b/Lib/ldap/controls/sss.py @@ -5,13 +5,12 @@ ldap.controls.sss - classes for Server Side Sorting See http://www.python-ldap.org/ for project details. -$Id: sss.py,v 1.1 2015/06/22 16:47:08 stroeder Exp $ +$Id: sss.py,v 1.2 2015/10/24 15:52:23 stroeder Exp $ """ __all__ = [ 'SSSRequestControl', 'SSSResponseControl', - 'SSSVLVPagedLDAPObject' ] From c6b18c750bfd03b46f7a00be098dc327b1704117 Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 15:55:07 +0000 Subject: [PATCH 10/14] Corrected ldap.controls.pwdpolicy.__all__ --- CHANGES | 3 ++- Lib/ldap/controls/pwdpolicy.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 6f2301f..cf8757a 100644 --- a/CHANGES +++ b/CHANGES @@ -14,6 +14,7 @@ Lib/ generic wrapper arguments *args,**kwargs * LDIFParser.parse_change_records() now correctly calls LDIFParser.handle_change_modify() +* Corrected ldap.controls.pwdpolicy.__all__ Doc/ * Started missing docs for sub-module ldap.sasl. @@ -1215,4 +1216,4 @@ Released 2.0.0pre02 2002-02-01 ---------------------------------------------------------------- Released 1.10alpha3 2000-09-19 -$Id: CHANGES,v 1.362 2015/10/24 15:50:00 stroeder Exp $ +$Id: CHANGES,v 1.363 2015/10/24 15:55:07 stroeder Exp $ diff --git a/Lib/ldap/controls/pwdpolicy.py b/Lib/ldap/controls/pwdpolicy.py index 0cb4260..dc013d4 100644 --- a/Lib/ldap/controls/pwdpolicy.py +++ b/Lib/ldap/controls/pwdpolicy.py @@ -5,11 +5,12 @@ ldap.controls.pwdpolicy - classes for Password Policy controls See http://www.python-ldap.org/ for project details. -$Id: pwdpolicy.py,v 1.4 2014/03/12 21:34:07 stroeder Exp $ +$Id: pwdpolicy.py,v 1.5 2015/10/24 15:55:07 stroeder Exp $ """ __all__ = [ - 'ExpirationWarningControl' + 'PasswordExpiringControl', + 'PasswordExpiredControl', ] # Imports from python-ldap 2.4+ From b8844cb5264febf18371a63947b1becbaa1ea67d Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 16:12:31 +0000 Subject: [PATCH 11/14] Prefer method name handle_modify() --- Lib/ldif.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/ldif.py b/Lib/ldif.py index 7466020..5145190 100644 --- a/Lib/ldif.py +++ b/Lib/ldif.py @@ -3,7 +3,7 @@ ldif - generate and parse LDIF data (see RFC 2849) See http://www.python-ldap.org/ for details. -$Id: ldif.py,v 1.86 2015/10/24 15:50:00 stroeder Exp $ +$Id: ldif.py,v 1.87 2015/10/24 16:12:31 stroeder Exp $ Python compability note: Tested with Python 2.0+, but should work with Python 1.5.2+. @@ -391,7 +391,7 @@ class LDIFParser: """ return self.parse_entry_records() # parse() - def handle_change_modify(self,dn,modops,controls=None): + def handle_modify(self,dn,modops,controls=None): """ Process a single LDIF record representing a single modify operation. This method should be implemented by applications using LDIFParser. @@ -467,7 +467,7 @@ class LDIFParser: if modops: # append entry to result list - self.handle_change_modify(dn,modops,controls) + self.handle_modify(dn,modops,controls) else: From 5d85c44b836313b4b6969e47e5dbf903e09cfa79 Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 16:21:14 +0000 Subject: [PATCH 12/14] Explicitly list limit exception types --- Demo/pyasn1/noopsearch.py | 8 +++++--- Lib/ldap/controls/openldap.py | 9 +++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Demo/pyasn1/noopsearch.py b/Demo/pyasn1/noopsearch.py index a22f394..e2846ce 100644 --- a/Demo/pyasn1/noopsearch.py +++ b/Demo/pyasn1/noopsearch.py @@ -14,8 +14,6 @@ import sys,ldap,ldapurl,getpass from ldap.controls.openldap import SearchNoOpControl -LDAPLimitErrors = (ldap.TIMEOUT,ldap.TIMELIMIT_EXCEEDED,ldap.SIZELIMIT_EXCEEDED,ldap.ADMINLIMIT_EXCEEDED) - SEARCH_TIMEOUT=30.0 try: @@ -56,7 +54,11 @@ try: serverctrls=[SearchNoOpControl(criticality=True)], ) _,_,_,search_response_ctrls = ldap_conn.result3(msg_id,all=1,timeout=SEARCH_TIMEOUT) -except LDAPLimitErrors,e: +except ( + ldap.TIMEOUT, + ldap.TIMELIMIT_EXCEEDED, + ldap.SIZELIMIT_EXCEEDED, + ldap.ADMINLIMIT_EXCEEDED),e: ldap_conn.abandon(msg_id) sys.exit(1) diff --git a/Lib/ldap/controls/openldap.py b/Lib/ldap/controls/openldap.py index 53425e0..8480e7c 100644 --- a/Lib/ldap/controls/openldap.py +++ b/Lib/ldap/controls/openldap.py @@ -4,7 +4,7 @@ ldap.controls.openldap - classes for OpenLDAP-specific controls See http://www.python-ldap.org/ for project details. -$Id: openldap.py,v 1.4 2015/09/18 17:24:39 stroeder Exp $ +$Id: openldap.py,v 1.5 2015/10/24 16:21:14 stroeder Exp $ """ import ldap.controls @@ -63,7 +63,12 @@ class SearchNoOpMixIn: serverctrls=[SearchNoOpControl(criticality=True)], ) _,_,_,search_response_ctrls = self.result3(msg_id,all=1,timeout=timeout) - except LDAPLimitErrors,e: + except ( + ldap.TIMEOUT, + ldap.TIMELIMIT_EXCEEDED, + ldap.SIZELIMIT_EXCEEDED, + ldap.ADMINLIMIT_EXCEEDED + ),e: self.abandon(msg_id) raise e else: From 4df497cca5ab155f631eaeaddcf65db2912eaa75 Mon Sep 17 00:00:00 2001 From: stroeder Date: Sat, 24 Oct 2015 16:21:56 +0000 Subject: [PATCH 13/14] Added SearchNoOpMixIn to __all__ --- Lib/ldap/controls/openldap.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lib/ldap/controls/openldap.py b/Lib/ldap/controls/openldap.py index 8480e7c..99c2baa 100644 --- a/Lib/ldap/controls/openldap.py +++ b/Lib/ldap/controls/openldap.py @@ -4,7 +4,7 @@ ldap.controls.openldap - classes for OpenLDAP-specific controls See http://www.python-ldap.org/ for project details. -$Id: openldap.py,v 1.5 2015/10/24 16:21:14 stroeder Exp $ +$Id: openldap.py,v 1.6 2015/10/24 16:21:56 stroeder Exp $ """ import ldap.controls @@ -15,7 +15,8 @@ from pyasn1.codec.ber import decoder __all__ = [ - 'SearchNoOpControl' + 'SearchNoOpControl', + 'SearchNoOpMixIn', ] From 277a6f2add838667b76f24110ee9adc8256906b6 Mon Sep 17 00:00:00 2001 From: stroeder Date: Thu, 19 Nov 2015 05:16:46 +0000 Subject: [PATCH 14/14] Fixed typos --- Doc/ldap.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/ldap.rst b/Doc/ldap.rst index ef870bd..ccb661a 100644 --- a/Doc/ldap.rst +++ b/Doc/ldap.rst @@ -1,4 +1,4 @@ -.. % $Id: ldap.rst,v 1.28 2015/06/05 20:49:04 stroeder Exp $ +.. % $Id: ldap.rst,v 1.29 2015/11/19 05:16:46 stroeder Exp $ ******************************************** :py:mod:`ldap` LDAP library interface module @@ -107,7 +107,7 @@ Options .. seealso:: - :manpage:`ldap.conf{5}` and :manpage:`ldap_get_options{3}` + :manpage:`ldap.conf(5)` and :manpage:`ldap_get_option(3)` For use with functions :py:func:set_option() and :py:func:get_option()