Skip to content
This repository has been archived by the owner on Jan 23, 2021. It is now read-only.

Commit

Permalink
Support new scope value for draft-sermersheim-ldap-subordinate-scope
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed Mar 12, 2014
1 parent 543582f commit 3ac9497
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ Lib/
string of digits
* Support for X-SUBST in schema element class LDAPSyntax
* Support for X-ORDERED and X-ORIGIN in schema element class AttributeType
* ldapurl: New scope 'subordinates' defined in
draft-sermersheim-ldap-subordinate-scope

Modules/
* New constant ldap.SCOPE_SUBORDINATE derived from ldap.h for
draft-sermersheim-ldap-subordinate-scope

----------------------------------------------------------------
Released 2.4.14 2014-01-31
Expand Down Expand Up @@ -1092,4 +1096,4 @@ Released 2.0.0pre02 2002-02-01
----------------------------------------------------------------
Released 1.10alpha3 2000-09-19

$Id: CHANGES,v 1.315 2014/03/12 21:44:10 stroeder Exp $
$Id: CHANGES,v 1.316 2014/03/12 23:02:42 stroeder Exp $
7 changes: 5 additions & 2 deletions Lib/ldapurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
See http://www.python-ldap.org/ for details.
\$Id: ldapurl.py,v 1.63 2013/08/13 12:33:08 stroeder Exp $
\$Id: ldapurl.py,v 1.64 2014/03/12 23:02:42 stroeder Exp $
Python compability note:
This module only works with Python 2.0+ since
Expand All @@ -30,15 +30,18 @@
LDAP_SCOPE_BASE = 0
LDAP_SCOPE_ONELEVEL = 1
LDAP_SCOPE_SUBTREE = 2
LDAP_SCOPE_SUBORDINATES = 3

SEARCH_SCOPE_STR = {None:'',0:'base',1:'one',2:'sub'}
SEARCH_SCOPE_STR = {None:'',0:'base',1:'one',2:'sub',3:'subordinates'}

SEARCH_SCOPE = {
'':None,
# the search scope strings defined in RFC 4516
'base':LDAP_SCOPE_BASE,
'one':LDAP_SCOPE_ONELEVEL,
'sub':LDAP_SCOPE_SUBTREE,
# from draft-sermersheim-ldap-subordinate-scope
'subordinates':LDAP_SCOPE_SUBORDINATES,
}

# Some widely used types
Expand Down
8 changes: 7 additions & 1 deletion Modules/constants.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* constants defined for LDAP
* See http://www.python-ldap.org/ for details.
* $Id: constants.c,v 1.57 2013/09/11 08:16:27 stroeder Exp $ */
* $Id: constants.c,v 1.58 2014/03/12 23:02:42 stroeder Exp $ */

#include "common.h"
#include "constants.h"
Expand Down Expand Up @@ -119,6 +119,9 @@ LDAPinit_constants( PyObject* d )
add_int(d,SCOPE_BASE);
add_int(d,SCOPE_ONELEVEL);
add_int(d,SCOPE_SUBTREE);
#ifdef LDAP_SCOPE_SUBORDINATE
add_int(d,SCOPE_SUBORDINATE);
#endif
add_int(d,MOD_ADD);
add_int(d,MOD_DELETE);
add_int(d,MOD_REPLACE);
Expand Down Expand Up @@ -191,6 +194,9 @@ LDAPinit_constants( PyObject* d )
#ifdef LDAP_OPT_X_TLS_CIPHER
add_int(d,OPT_X_TLS_CIPHER);
#endif
#ifdef LDAP_OPT_X_TLS_PEERCERT
add_int(d,OPT_X_TLS_PEERCERT);
#endif
#ifdef LDAP_OPT_X_TLS_CRLCHECK
/* only available if OpenSSL supports it => might cause backward compability problems */
add_int(d,OPT_X_TLS_CRLCHECK);
Expand Down

0 comments on commit 3ac9497

Please sign in to comment.