From afb520a6e9395d09be0391d198e3be7b92e84a99 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Tue, 30 Dec 2003 01:34:05 +0000 Subject: [PATCH] LDAP_SCOPE SUBORDINATE implementation --- libraries/libldap/request.c | 2 ++ libraries/libldap/url.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/libraries/libldap/request.c b/libraries/libldap/request.c index ba77cc8b0b..6e49857514 100644 --- a/libraries/libldap/request.c +++ b/libraries/libldap/request.c @@ -1229,7 +1229,9 @@ re_encode_request( LDAP *ld, scope = LDAP_SCOPE_BASE; break; case LDAP_SCOPE_SUBTREE: +#ifdef LDAP_FEATURE_SUBORDINATE_SCOPE case LDAP_SCOPE_SUBORDINATE: +#endif scope = LDAP_SCOPE_SUBTREE; break; } diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index c5e284bb96..87cfcbc148 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -246,11 +246,13 @@ static int str2scope( const char *p ) } else if ( strcasecmp( p, "subtree" ) == 0 ) { return LDAP_SCOPE_SUBTREE; +#ifdef LDAP_FEATURE_SUBORDINATE_SCOPE } else if ( strcasecmp( p, "subordinate" ) == 0 ) { return LDAP_SCOPE_SUBORDINATE; } else if ( strcasecmp( p, "children" ) == 0 ) { return LDAP_SCOPE_SUBORDINATE; +#endif } return( -1 ); @@ -350,7 +352,9 @@ char * ldap_url_desc2str( LDAPURLDesc *u ) case LDAP_SCOPE_BASE: case LDAP_SCOPE_ONELEVEL: case LDAP_SCOPE_SUBTREE: +#ifdef LDAP_FEATURE_SUBORDINATE_SCOPE case LDAP_SCOPE_SUBORDINATE: +#endif len += sizeof("subordinate"); if( !sep ) sep = 3; break; @@ -420,10 +424,12 @@ char * ldap_url_desc2str( LDAPURLDesc *u ) strcpy( &s[sofar], "sub" ); sofar += sizeof("sub") - 1; break; +#ifdef LDAP_FEATURE_SUBORDINATE_SCOPE case LDAP_SCOPE_SUBORDINATE: strcpy( &s[sofar], "children" ); sofar += sizeof("children") - 1; break; +#endif } if( sep < 4 ) goto done; -- 2.39.5