]> git.sur5r.net Git - openldap/commitdiff
cleanup for release engineering
authorKurt Zeilenga <kurt@openldap.org>
Thu, 18 Mar 2004 01:06:39 +0000 (01:06 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 18 Mar 2004 01:06:39 +0000 (01:06 +0000)
15 files changed:
clients/tools/ldapsearch.c
include/ldap.h
libraries/libldap/groupings.c
libraries/libldap/test.c
libraries/libldap/txn.c
libraries/libldap/url.c
servers/slapd/back-bdb/search.c
servers/slapd/back-ldbm/filterindex.c
servers/slapd/back-ldbm/search.c
servers/slapd/backend.c
servers/slapd/backglue.c
servers/slapd/config.c
servers/slapd/saslauthz.c
servers/slapd/search.c
servers/slapd/slap.h

index 633170c73de3776311d2d41e9385c092c16f7f28..84dddea57eb181ecc6c255637f6405a393f9406a 100644 (file)
@@ -443,10 +443,12 @@ handle_private_option( int i )
                        scope = LDAP_SCOPE_BASE;
                } else if ( strncasecmp( optarg, "one", sizeof("one")-1 ) == 0 ) {
                        scope = LDAP_SCOPE_ONELEVEL;
+#ifdef LDAP_SCOPE_SUBORDINATE
                } else if (( strcasecmp( optarg, "subordinate" ) == 0 )
                        || ( strcasecmp( optarg, "children" ) == 0 ))
                {
                        scope = LDAP_SCOPE_SUBORDINATE;
+#endif
                } else if ( strncasecmp( optarg, "sub", sizeof("sub")-1 ) == 0 ) {
                        scope = LDAP_SCOPE_SUBTREE;
                } else {
@@ -764,8 +766,14 @@ getNextPage:
                        base ? base : "",
                        ((scope == LDAP_SCOPE_BASE) ? "baseObject"
                                : ((scope == LDAP_SCOPE_ONELEVEL) ? "oneLevel"
+#ifdef LDAP_SCOPE_SUBORDINATE
                                : ((scope == LDAP_SCOPE_SUBORDINATE) ? "children"
-                               : "subtree"))));
+#endif
+                               : "subtree"
+#ifdef LDAP_SCOPE_SUBORDINATE
+                               )
+#endif
+                               )));
                printf(_("# filter%s: %s\n"), infile != NULL ? _(" pattern") : "",
                       filtpattern);
                printf(_("# requesting: "));
index f5f2a334e6371b14f490956567cbf320d4258749..3ac129ead4d68fd5b70e28b9a8fb73b3144fefd8 100644 (file)
@@ -223,8 +223,10 @@ typedef struct ldapcontrol {
 #define LDAP_CONTROL_VLVRESPONSE    "2.16.840.1.113730.3.4.10"
 
 /* Password policy Controls *//* work in progress */
+#ifdef LDAP_DEVEL
 #define LDAP_CONTROL_PASSWORDPOLICYREQUEST     "1.3.6.1.4.1.42.2.27.8.5.1"
 #define LDAP_CONTROL_PASSWORDPOLICYRESPONSE    "1.3.6.1.4.1.42.2.27.8.5.1"
+#endif
 
 /* LDAP Sync -- draft-zeilenga-ldup-sync *//* submitted for publication */
 #define LDAP_SYNC_OID                  "1.3.6.1.4.1.4203.1.9.1"
@@ -282,6 +284,7 @@ typedef struct ldapcontrol {
 #define LDAP_EXOP_X_CANCEL             "1.3.6.1.4.1.4203.666.6.3"
 
 /* LDAP Grouping of Related Operations *//* a work in progress */
+#ifdef LDAP_DEVEL
 #define LDAP_X_GROUPING_BASE           "1.3.6.1.4.1.4203.666.10.3"
 #define LDAP_EXOP_GROUPING_CREATE      LDAP_X_GROUPING_BASE ".1"
 #define LDAP_EXOP_GROUPING_END         LDAP_X_GROUPING_BASE ".2"
@@ -289,9 +292,12 @@ typedef struct ldapcontrol {
 #define LDAP_EXOP_GROUPING_ACTION      LDAP_X_GROUPING_BASE ".4"
 #define LDAP_NOTICE_GROUPING_INFO      LDAP_X_GROUPING_BASE ".5"
 #define LDAP_CONTROL_GROUPING          LDAP_X_GROUPING_BASE ".6"
+#endif
 
 /* LDAP Grouping Types *//* a work in progress */
+#ifdef LDAP_DEVEL
 #define LDAP_GROUP_TRANSACTION          "1.3.6.1.4.1.4203.666.10.4"
+#endif
 
 /* LDAP Features */
 #define LDAP_FEATURE_ALL_OP_ATTRS      "1.3.6.1.4.1.4203.1.5.1"        /* RFC 3673 */
@@ -301,10 +307,12 @@ typedef struct ldapcontrol {
 #define LDAP_FEATURE_LANGUAGE_TAG_OPTIONS "1.3.6.1.4.1.4203.1.5.4"
 #define LDAP_FEATURE_LANGUAGE_RANGE_OPTIONS "1.3.6.1.4.1.4203.1.5.5"
 
+#ifdef LDAP_DEVEL
 #define LDAP_FEATURE_SUBORDINATE_SCOPE \
        "1.3.6.1.4.1.4203.666.8.1" /* "children" */
 #define LDAP_FEATURE_CHILDREN_SCOPE LDAP_FEATURE_SUBORDINATE_SCOPE
 #define LDAP_FEATURE_MODIFY_INCREMENT "1.3.6.1.4.1.4203.666.8.2"
+#endif
 
 /*
  * specific LDAP instantiations of BER types we know about
@@ -424,8 +432,10 @@ typedef struct ldapcontrol {
 #define LDAP_SCOPE_ONE                 LDAP_SCOPE_ONELEVEL
 #define LDAP_SCOPE_SUBTREE             ((ber_int_t) 0x0002)
 #define LDAP_SCOPE_SUB                 LDAP_SCOPE_SUBTREE
+#ifdef LDAP_DEVEL
 #define LDAP_SCOPE_SUBORDINATE ((ber_int_t) 0x0003) /* OpenLDAP extension */
 #define LDAP_SCOPE_CHILDREN            LDAP_SCOPE_SUBORDINATE
+#endif
 
 /* substring filter component types */
 #define LDAP_SUBSTRING_INITIAL ((ber_tag_t) 0x80U)     /* context specific */
@@ -744,7 +754,7 @@ ldap_parse_intermediate LDAP_P((
  */
 
 LDAP_F( int )
-ldap_grouping_create_operation LDAP_P((
+ldap_grouping_create LDAP_P((
        LDAP                    *ld,
        LDAP_CONST char *grpoid,
        struct berval   *grpdata,
@@ -753,7 +763,7 @@ ldap_grouping_create_operation LDAP_P((
        int                             *msgidp ));
 
 LDAP_F( int )
-ldap_grouping_create_operation_s LDAP_P((
+ldap_grouping_create_s LDAP_P((
        LDAP                    *ld,
        LDAP_CONST char *grpoid,
        struct berval   *grpdata,
@@ -772,7 +782,7 @@ ldap_parse_grouping_create_result LDAP_P((
        int                             freeit ));
 
 LDAP_F( int )
-ldap_grouping_end_operation LDAP_P((
+ldap_grouping_end LDAP_P((
        LDAP                    *ld,
        LDAP_CONST char *grpoid,
        struct berval   *grpdata,
@@ -781,7 +791,7 @@ ldap_grouping_end_operation LDAP_P((
        int                             *msgidp ));
 
 LDAP_F( int )
-ldap_grouping_end_operation_s LDAP_P((
+ldap_grouping_end_s LDAP_P((
        LDAP                    *ld,
        LDAP_CONST char *grpoid,
        struct berval   *grpdata,
@@ -1844,6 +1854,7 @@ ldap_parse_vlv_control LDAP_P((
  * LDAP Transactions
  *     in txn.c
  */
+#ifdef LDAP_GROUPING_TRANSACTION
 LDAP_F( int )
 ldap_parse_txn_create LDAP_P((
        LDAP *ld,
@@ -1880,6 +1891,7 @@ ldap_txn_end_s LDAP_P((
        int commit,
        LDAPControl **sctrls,
        LDAPControl **cctrls ));
+#endif
 
 /*
  * LDAP Who Am I?
index 42f6e9528e1a690c91d9d91de733b3d953ec6e19..001b30c6b4b5695b33ee28a36d0e7a3144c6c85b 100644 (file)
 
 #include "ldap-int.h"
 
+#ifdef LDAP_EXOP_GROUPING_CREATE
 
+int ldap_grouping_create(
+       LDAP *ld,
+       LDAP_CONST char *grpoid,
+       struct berval *grpdata,
+       LDAPControl **sctrls,
+       LDAPControl **cctrls,
+       int *msgidp )
+{
+       int rc;
+       BerElement *ber = NULL;
+       struct berval bv = {0, NULL};
 
+#ifdef NEW_LOGGING
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_grouping_create\n", 0,0,0 );
+#else
+       Debug( LDAP_DEBUG_TRACE, "ldap_grouping_create\n", 0, 0, 0 );
+#endif
+
+       assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
+       assert( grpoid != NULL || *grpoid == '\0' );
+       assert( msgidp != NULL );
+
+       /* build the create grouping exop */
+       ber = ber_alloc_t( LBER_USE_DER );
+       if( ber == NULL ) {
+               ld->ld_errno = LDAP_NO_MEMORY;
+               return( ld->ld_errno );
+       }
+
+       if ( grpdata != NULL ) {
+               ber_printf( ber, "{sON}", grpoid, grpdata );
+       } else {
+               ber_printf( ber, "{sN}", grpoid );
+       }
+
+       rc = ber_flatten2( ber, &bv, 0 );
+
+       if( rc < 0 ) {
+               ld->ld_errno = LDAP_ENCODING_ERROR;
+               return( ld->ld_errno );
+       }
+
+       rc = ldap_extended_operation( ld, LDAP_EXOP_GROUPING_CREATE,
+               &bv, sctrls, cctrls, msgidp );
+
+       ber_free( ber, 1 );
+       return rc;
+}
+
+int ldap_grouping_create_s(
+       LDAP *ld,
+       LDAP_CONST char *grpoid,
+       struct berval *grpdata,
+       LDAPControl **sctrls,
+       LDAPControl **cctrls,
+       struct berval **retgrpcookiep,
+       struct berval **retgrpdatap )
+{
+    int     rc;
+    int     msgid;
+    LDAPMessage *res;
+
+#ifdef NEW_LOGGING
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_grouping_create_s\n", 0,0,0 );
+#else
+       Debug( LDAP_DEBUG_TRACE, "ldap_grouping_create_s\n", 0, 0, 0 );
+#endif
+
+       assert( ld != NULL );
+       assert( LDAP_VALID( ld ) );
+       assert( grpoid != NULL || *grpoid == '\0' );
+
+    rc = ldap_grouping_create( ld, grpoid, grpdata,
+               sctrls, cctrls, &msgid );
+    if ( rc != LDAP_SUCCESS ) {
+        return rc;
+       }
+    if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, &res ) == -1 ) {
+        return ld->ld_errno;
+       }
+
+       if ( retgrpcookiep != NULL ) *retgrpcookiep = NULL;
+       if ( retgrpdatap != NULL ) *retgrpdatap = NULL;
+
+#if 0
+       rc = ldap_parse_extended_result( ld, res, retoidp, retdatap, 0 );
+#else
+       rc = LDAP_NOT_SUPPORTED;
+#endif
+
+       if( rc != LDAP_SUCCESS ) {
+               ldap_msgfree( res );
+               return rc;
+       }
+
+    return( ldap_result2error( ld, res, 1 ) );
+}
+
+int ldap_grouping_end(
+       LDAP *ld,
+       LDAP_CONST char *grpoid,
+       struct berval *grpdata,
+       LDAPControl **sctrls,
+       LDAPControl **cctrls,
+       int *msgidp )
+{
+}
+
+int ldap_grouping_end_s(
+       LDAP *ld,
+       LDAP_CONST char *grpoid,
+       struct berval *grpdata,
+       LDAPControl **sctrls,
+       LDAPControl **cctrls,
+       struct berval **retgrpdatap )
+{
+}
+
+#endif
index 3d24fb099af019b83d833f7fdd8258baef5ecc15..67b74616365262de22ec6bb9873d28e9c9b023a7 100644 (file)
@@ -640,7 +640,9 @@ main( int argc, char **argv )
                                        ludp->lud_scope == LDAP_SCOPE_BASE ? "baseObject"
                                        : ludp->lud_scope == LDAP_SCOPE_ONELEVEL ? "oneLevel"
                                        : ludp->lud_scope == LDAP_SCOPE_SUBTREE ? "subtree"
+#ifdef LDAP_SCOPE_SUBORDINATE
                                        : ludp->lud_scope == LDAP_SCOPE_SUBORDINATE ? "children"
+#endif
                                        : "**invalid**" );
                            printf( "\tfilter: <%s>\n", ludp->lud_filter );
                            ldap_free_urldesc( ludp );
index 575eb49bb500074d3ad0dc0029b659e5329c1463..3f40599d8b1545f476c5c19913fa0caed5f450e9 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "ldap-int.h"
 
+#ifdef LDAP_GROUP_TRANSACTION
+
 int
 ldap_txn_create_s(
        LDAP *ld,
@@ -46,3 +48,5 @@ ldap_txn_end_s(
 {
        return LDAP_NOT_SUPPORTED;
 }
+
+#endif
index 19da2df6f93bfec96a1c351e8a19e257cdb10081..640218c7dc0b4bdcd7237791a6002c30835df05e 100644 (file)
@@ -246,7 +246,7 @@ static int str2scope( const char *p )
        } else if ( strcasecmp( p, "subtree" ) == 0 ) {
                return LDAP_SCOPE_SUBTREE;
 
-#ifdef LDAP_FEATURE_SUBORDINATE_SCOPE
+#ifdef LDAP_SCOPE_SUBORDINATE
        } else if ( strcasecmp( p, "subordinate" ) == 0 ) {
                return LDAP_SCOPE_SUBORDINATE;
 
index 1260cf54ab01a5f4fb861b30f2b96918a1e351cf..97da998b23738305878c64e7bafafba8263c3035 100644 (file)
@@ -969,9 +969,11 @@ id2entry_retry:
                        if ( ei->bei_parent->bei_id == base.e_id ) scopeok = 1;
                        break;
 
+#ifdef LDAP_SCOPE_CHILDREN
                case LDAP_SCOPE_CHILDREN:
                        if ( id == base.e_id ) break;
                        /* Fall-thru */
+#endif
                case LDAP_SCOPE_SUBTREE: {
                        EntryInfo *tmp;
                        for (tmp = BEI(e); tmp->bei_parent;
index 8758db0d0ce301c5cfea7734705101679e244173..1b5d86b1cc4587c1d5df48acc003797ab1cd50ff 100644 (file)
@@ -89,8 +89,10 @@ filter_candidates(
                }
                break;
 
+#ifdef SLAPD_FILTER_DN_CHILDREN
        case SLAPD_FILTER_DN_CHILDREN:
                sub = "CHILDREN";
+#endif
        case SLAPD_FILTER_DN_SUBTREE:
 #ifdef NEW_LOGGING
                LDAP_LOG( FILTER, DETAIL1, 
index 4aaaa8a458a24129fecc6376182806e320b53be5..acebe63641c2d0c826fe6a18b98bacfb8e951288 100644 (file)
@@ -347,11 +347,13 @@ searchit:
                        {
                                scopeok = dnIsSuffix( &e->e_nname, &realbase );
 
+#ifdef LDAP_SCOPE_SUBORDINATE
                        } else if ( !scopeok
                                && op->ors_scope == LDAP_SCOPE_SUBORDINATE )
                        {
                                scopeok = !dn_match( &e->e_nname, &realbase )
                                        && dnIsSuffix( &e->e_nname, &realbase );
+#endif
 
                        } else {
                                scopeok = 1;
@@ -409,11 +411,13 @@ searchit:
                        {
                                scopeok = dnIsSuffix( &e->e_nname, &realbase );
 
+#ifdef LDAP_SCOPE_SUBORDINATE
                        } else if ( !scopeok &&
                                op->ors_scope == LDAP_SCOPE_SUBORDINATE )
                        {
                                scopeok = !dn_match( &e->e_nname, &realbase )
                                        && dnIsSuffix( &e->e_nname, &realbase );
+#endif
 
                        } else {
                                scopeok = 1;
index 344ba7354580f08055dcc4d09a049a4fffa79cb5..21dd29003f1f37591a5de3e4625c14d8d5b9a9cf 100644 (file)
@@ -1289,12 +1289,14 @@ backend_group(
                                                case LDAP_SCOPE_SUBTREE:
                                                        if ( !dnIsSuffix( op_ndn, &nbase )) goto loopit;
                                                        break;
+#ifdef LDAP_SCOPE_SUBORDINATE
                                                case LDAP_SCOPE_SUBORDINATE:
                                                        if ( dn_match( &nbase, op_ndn ) &&
                                                                !dnIsSuffix(op_ndn, &nbase ))
                                                        {
                                                                goto loopit;
                                                        }
+#endif
                                                }
                                                filter = str2filter_x( op, ludp->lud_filter );
                                                if ( filter ) {
index d8c13e96906d9de82292bd860bb5a66079496866..d76154743a18e1dbfa8a37b76b7beb23d3774a20 100644 (file)
@@ -281,7 +281,9 @@ glue_back_search ( Operation *op, SlapReply *rs )
 
        case LDAP_SCOPE_ONELEVEL:
        case LDAP_SCOPE_SUBTREE:
+#ifdef LDAP_SCOPE_SUBORDINATE
        case LDAP_SCOPE_SUBORDINATE: /* FIXME */
+#endif
                op->o_callback = &cb;
                rs->sr_err = gs.err = LDAP_UNWILLING_TO_PERFORM;
                scope0 = op->ors_scope;
index d161180a176b152883689c76ed2cebee50d905de..aa75227507ce88da72c57c6cd3eca6cf2f242d99 100644 (file)
@@ -3100,10 +3100,12 @@ parse_syncrepl_line(
                                si->si_scope = LDAP_SCOPE_BASE;
                        } else if ( !strncasecmp( val, "one", sizeof( "one" ) - 1 )) {
                                si->si_scope = LDAP_SCOPE_ONELEVEL;
+#ifdef LDAP_SCOPE_SUBORDINATE
                        } else if ( !strcasecmp( val, "subordinate" ) ||
                                !strcasecmp( val, "children" ))
                        {
                                si->si_scope = LDAP_SCOPE_SUBORDINATE;
+#endif
                        } else if ( !strncasecmp( val, "sub", sizeof( "sub" ) - 1 )) {
                                si->si_scope = LDAP_SCOPE_SUBTREE;
                        } else {
index 725f4de0749c2f0a3c4f3391f67357993bb5cee7..50d9d297ddbd8c87c15cb4b06a169ef3be9d1cc4 100644 (file)
@@ -898,7 +898,9 @@ void slap_sasl2dn( Operation *opx,
 
        case LDAP_SCOPE_ONELEVEL:
        case LDAP_SCOPE_SUBTREE:
+#ifdef LDAP_SCOPE_SUBORDINATE
        case LDAP_SCOPE_SUBORDINATE:
+#endif
                /* do a search */
                break;
 
index ee168664bb83cf9c1d7cc8bb08bc51f331029b98..91dcdb2b2f0115d29affcc522e9ee285b489150f 100644 (file)
@@ -102,7 +102,9 @@ do_search(
        case LDAP_SCOPE_BASE:
        case LDAP_SCOPE_ONELEVEL:
        case LDAP_SCOPE_SUBTREE:
+#ifdef LDAP_SCOPE_SUBORDINATE
        case LDAP_SCOPE_SUBORDINATE:
+#endif
                break;
        default:
                send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "invalid scope" );
index 0112072d57e529a7536c099f32c38d6e38956cf7..52fdceeb5076b7732bb6a4a9df690a560ecd41ed 100644 (file)
@@ -875,7 +875,9 @@ typedef struct slap_filter {
 #define SLAPD_FILTER_COMPUTED          ((ber_tag_t) -1)
 #define SLAPD_FILTER_DN_ONE                    ((ber_tag_t) -2)
 #define SLAPD_FILTER_DN_SUBTREE                ((ber_tag_t) -3)
+#ifdef LDAP_SCOPE_SUBORDINATE
 #define SLAPD_FILTER_DN_CHILDREN       ((ber_tag_t) -4)
+#endif
 
        union f_un_u {
                /* precomputed result */