]> git.sur5r.net Git - openldap/commitdiff
unifdef LDAP_SYNC and LDAP_SYNCREPL
authorJong Hyuk Choi <jongchoi@openldap.org>
Wed, 27 Aug 2003 22:16:04 +0000 (22:16 +0000)
committerJong Hyuk Choi <jongchoi@openldap.org>
Wed, 27 Aug 2003 22:16:04 +0000 (22:16 +0000)
42 files changed:
clients/tools/ldapsearch.c
include/ldap.h
libraries/libldap/error.c
servers/slapd/add.c
servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/back-bdb.h
servers/slapd/back-bdb/cache.c
servers/slapd/back-bdb/ctxcsn.c
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/init.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c
servers/slapd/back-bdb/passwd.c
servers/slapd/back-bdb/proto-bdb.h
servers/slapd/back-bdb/search.c
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/back-ldbm.h
servers/slapd/back-ldbm/bind.c
servers/slapd/back-ldbm/delete.c
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/modrdn.c
servers/slapd/back-ldbm/passwd.c
servers/slapd/back-ldbm/search.c
servers/slapd/backend.c
servers/slapd/cancel.c
servers/slapd/config.c
servers/slapd/connection.c
servers/slapd/controls.c
servers/slapd/ctxcsn.c
servers/slapd/daemon.c
servers/slapd/delete.c
servers/slapd/modify.c
servers/slapd/modrdn.c
servers/slapd/operation.c
servers/slapd/passwd.c
servers/slapd/proto-slap.h
servers/slapd/schema_check.c
servers/slapd/schema_prep.c
servers/slapd/search.c
servers/slapd/slap.h
servers/slapd/syncrepl.c
servers/slapd/tools/mimic.c

index e98d36892399bcb6dabe234b05c7d408260b11eb..31be49d5f0b4385c6e64b69997cc226eba7a9182 100644 (file)
@@ -75,10 +75,8 @@ usage( void )
 #ifdef LDAP_CONTROL_SUBENTRIES
        fprintf( stderr, _("             [!]subentries[=true|false]  (subentries)\n"));
 #endif
-#ifdef LDAP_SYNC
        fprintf( stderr, _("             [!]sync=ro[/<cookie>]            (LDAP Sync refreshOnly)\n"));
        fprintf( stderr, _("                     rp[/<cookie>][/<slimit>] (LDAP Sync refreshAndPersist)\n"));
-#endif
        fprintf( stderr, _("  -F prefix  URL prefix for files (default: %s)\n"), def_urlpre);
        fprintf( stderr, _("  -l limit   time limit (in seconds) for search\n"));
        fprintf( stderr, _("  -L         print responses in LDIFv1 format\n"));
@@ -153,11 +151,9 @@ static char        *vrFilter = NULL;
 static int domainScope = 0;
 #endif
 
-#ifdef LDAP_SYNC
 static int ldapsync = 0;
 static struct berval sync_cookie = { 0, NULL };
 static int sync_slimit = -1;
-#endif
 
 #ifdef LDAP_CONTROL_PAGEDRESULTS
 static int pagedResults = 0;
@@ -313,7 +309,6 @@ handle_private_option( int i )
                        if( crit ) subentries *= -1;
 #endif
 
-#ifdef LDAP_SYNC
        } else if ( strcasecmp( control, "sync" ) == 0 ) {
                        char *cookiep;
                        char *slimitp;
@@ -357,7 +352,6 @@ handle_private_option( int i )
                                exit( EXIT_FAILURE );
                        }
                        if ( crit ) ldapsync *= -1;
-#endif
 
                } else {
                        fprintf( stderr, _("Invalid control name: %s\n"), control );
@@ -447,10 +441,8 @@ main( int argc, char **argv )
        LDAP            *ld = NULL;
        BerElement      *seber = NULL, *vrber = NULL, *prber = NULL;
 
-#ifdef LDAP_SYNC
        BerElement      *syncber = NULL;
        struct berval   *syncbvalp = NULL;
-#endif
 
        tool_init();
 
@@ -555,9 +547,7 @@ getNextPage:
 #ifdef LDAP_CONTROL_PAGEDRESULTS
                || pageSize
 #endif
-#ifdef LDAP_SYNC
                || ldapsync
-#endif
                || subentries || valuesReturnFilter )
        {
                int err;
@@ -597,7 +587,6 @@ getNextPage:
                }
 #endif
 
-#ifdef LDAP_SYNC
                if ( ldapsync ) {
                        if (( syncber = ber_alloc_t(LBER_USE_DER)) == NULL ) {
                                return EXIT_FAILURE;
@@ -625,7 +614,6 @@ getNextPage:
                        c[i].ldctl_iscritical = ldapsync < 0;
                        i++;
                }
-#endif
 
                if ( valuesReturnFilter ) {
                if (( vrber = ber_alloc_t(LBER_USE_DER)) == NULL ) {
@@ -831,12 +819,10 @@ static int dosearch(
        int                     npartial;
        LDAPMessage             *res, *msg;
        ber_int_t               msgid;
-#ifdef LDAP_SYNC
        char                    *retoid = NULL;
        struct berval           *retdata = NULL;
        int                     nresponses_psearch = -1;
        int                     cancel_msgid = -1;
-#endif
 
        if( filtpatt != NULL ) {
                filter = malloc( strlen( filtpatt ) + strlen( value ) );
@@ -894,10 +880,8 @@ static int dosearch(
                        msg = ldap_next_message( ld, msg ) )
                {
                        if ( nresponses++ ) putchar('\n');
-#if LDAP_SYNC
                        if ( nresponses_psearch >= 0 ) 
                                nresponses_psearch++;
-#endif
 
                        switch( ldap_msgtype( msg ) ) {
                        case LDAP_RES_SEARCH_ENTRY:
@@ -919,14 +903,12 @@ static int dosearch(
                                        goto done;
                                }
 
-#ifdef LDAP_SYNC
                                if ( cancel_msgid != -1 &&
                                                cancel_msgid == ldap_msgid( msg ) ) {
                                        printf(_("Cancelled \n"));
                                        printf(_("cancel_msgid = %d\n"), cancel_msgid);
                                        goto done;
                                }
-#endif
                                break;
 
                        case LDAP_RES_SEARCH_RESULT:
@@ -937,19 +919,14 @@ static int dosearch(
                                }
 #endif
 
-#ifdef LDAP_SYNC
                                if ( ldapsync == LDAP_SYNC_REFRESH_AND_PERSIST ) {
                                        break;
                                }
-#endif
 
                                goto done;
 
                        case LDAP_RES_INTERMEDIATE:
                                npartial++;
-#ifndef LDAP_SYNC
-                               print_partial( ld, msg );
-#else
                                ldap_parse_intermediate( ld, msg,
                                        &retoid, &retdata, NULL, 0 );
 
@@ -966,10 +943,8 @@ static int dosearch(
                                ldap_memfree( retoid );
                                ber_bvfree( retdata );
                                goto done;
-#endif
                        }
 
-#ifdef LDAP_SYNC
                        if ( ldapsync && sync_slimit != -1 &&
                                        nresponses_psearch >= sync_slimit ) {
                                BerElement *msgidber = NULL;
@@ -981,8 +956,6 @@ static int dosearch(
                                                msgidvalp, NULL, NULL, &cancel_msgid);
                                nresponses_psearch = -1;
                        }
-#endif
-
                }
 
                ldap_msgfree( res );
index 2fa360a33c32095b378ed49d6704e80cd06bd3b1..8a54468ad52e823986db83a15e4a838f0942277f 100644 (file)
@@ -201,9 +201,6 @@ typedef struct ldapcontrol {
 
 #define LDAP_CONTROL_PAGEDRESULTS              "1.2.840.113556.1.4.319"
 
-#define LDAP_SYNC 2
-#ifdef LDAP_SYNC
-#define LDAP_SYNCREPL 1
 #define LDAP_CONTROL_SYNC              "1.3.6.1.4.1.4203.666.5.6"
 #define LDAP_CONTROL_SYNC_STATE        "1.3.6.1.4.1.4203.666.5.7"
 #define LDAP_CONTROL_SYNC_DONE "1.3.6.1.4.1.4203.666.5.8"
@@ -222,7 +219,6 @@ typedef struct ldapcontrol {
 #define LDAP_SYNC_ADD                  1
 #define LDAP_SYNC_MODIFY               2
 #define LDAP_SYNC_DELETE               3
-#endif
 
 #define LDAP_CONTROL_SORTREQUEST    "1.2.840.113556.1.4.473"
 #define LDAP_CONTROL_SORTRESPONSE      "1.2.840.113556.1.4.474"
@@ -297,9 +293,7 @@ typedef struct ldapcontrol {
 
 #define LDAP_TAG_SASL_RES_CREDS        ((ber_tag_t) 0x87U)     /* context specific + primitive */
 
-#ifdef LDAP_SYNC
 #define LDAP_SYNC_TAG_COOKIE   ((ber_tag_t) 0x04U)     /* octet string */
-#endif
 
 
 /* possible operations a client can invoke */
@@ -476,14 +470,12 @@ typedef struct ldapcontrol {
 #define LDAP_CLIENT_LOOP                               0x60    /* draft-ietf-ldap-c-api-xx */
 #define LDAP_REFERRAL_LIMIT_EXCEEDED   0x61    /* draft-ietf-ldap-c-api-xx */
 
-#ifdef LDAP_SYNC
 #define LDAP_SYNC_RESOURCES_EXHAUSTED  0x100
 #define LDAP_SYNC_SECURITY_VIOLATION   0x101
 #define LDAP_SYNC_INVALID_COOKIE               0x102
 #define LDAP_SYNC_UNSUPPORTED_SCHEME   0x103
 #define LDAP_SYNC_CLIENT_DISCONNECT            0x104
 #define LDAP_SYNC_RELOAD_REQUIRED              0x105
-#endif
 
 #define LDAP_ASSERTION_FAILED                  0x10f
 
@@ -496,11 +488,9 @@ typedef struct ldapcontrol {
 #endif
 
 /* LDAP SYNC request type */
-#ifdef LDAP_SYNC
 #define LDAP_SYNC_NONE                                 0x00
 #define LDAP_SYNC_REFRESH_ONLY                 0x01
 #define LDAP_SYNC_REFRESH_AND_PERSIST  0x03
-#endif
 
 /*
  * This structure represents both ldap messages and ldap responses.
index ac8e1824166ce998637e04ab72df48298f736dba..e4359eca4f1b9ac89e512b77bf371276f572b275 100644 (file)
@@ -99,14 +99,12 @@ static struct ldaperror ldap_builtin_errlist[] = {
 
        {LDAP_ASSERTION_FAILED,                 N_("Assertion Failed")},
 
-#ifdef LDAP_SYNC
        {LDAP_SYNC_RESOURCES_EXHAUSTED, N_("Content Sync Resource Exhausted")},
        {LDAP_SYNC_SECURITY_VIOLATION,  N_("Content Sync Security Violation")},
        {LDAP_SYNC_INVALID_COOKIE,              N_("Content Sync Invalid Cookie")},
        {LDAP_SYNC_UNSUPPORTED_SCHEME,  N_("Content Sync Unsupported Scheme")},
        {LDAP_SYNC_CLIENT_DISCONNECT,   N_("Content Sync Client Disconnect")},
        {LDAP_SYNC_RELOAD_REQUIRED,             N_("Content Sync Reload Required")},
-#endif
 
 #ifdef LDAP_EXOP_X_CANCEL
        {LDAP_CANCELLED,                                N_("Cancelled")},
index e5bf5b67290936150a089dfea0a130583c8275f8..79e726be22a3c5447dad51c03d7d870ad328610e 100644 (file)
@@ -243,13 +243,11 @@ do_add( Operation *op, SlapReply *rs )
        if ( op->o_bd->be_add ) {
                /* do the update here */
                int repl_user = be_isupdate(op->o_bd, &op->o_ndn );
-#if defined(LDAP_SYNCREPL) && !defined(SLAPD_MULTIMASTER)
+#ifndef SLAPD_MULTIMASTER
                if ( !op->o_bd->syncinfo &&
                                                ( !op->o_bd->be_update_ndn.bv_len || repl_user ))
-#elif defined(LDAP_SYNCREPL) && defined(SLAPD_MULTIMASTER)
-               if ( !op->o_bd->syncinfo )      /* LDAP_SYNCREPL overrides MM */
-#elif !defined(LDAP_SYNCREPL) && !defined(SLAPD_MULTIMASTER)
-               if ( !op->o_bd->be_update_ndn.bv_len || repl_user )
+#else
+               if ( !op->o_bd->syncinfo )
 #endif
                {
                        int update = op->o_bd->be_update_ndn.bv_len;
@@ -311,7 +309,7 @@ do_add( Operation *op, SlapReply *rs )
                                e = NULL;
                        }
 
-#if defined(LDAP_SYNCREPL) || !defined(SLAPD_MULTIMASTER)
+#ifndef SLAPD_MULTIMASTER
                } else {
                        BerVarray defref = NULL;
 #ifdef LDAP_SLAPI
@@ -326,12 +324,9 @@ do_add( Operation *op, SlapReply *rs )
                        }
 #endif /* LDAP_SLAPI */
 
-#ifdef LDAP_SYNCREPL
                        if ( op->o_bd->syncinfo ) {
                                defref = op->o_bd->syncinfo->provideruri_bv;
-                       } else
-#endif
-                       {
+                       } else {
                                defref = op->o_bd->be_update_refs
                                                        ? op->o_bd->be_update_refs : default_referral;
                        }
@@ -376,9 +371,7 @@ do_add( Operation *op, SlapReply *rs )
 
 done:
 
-#ifdef LDAP_SYNC
        slap_graduate_commit_csn( op );
-#endif
 
        if( modlist != NULL ) {
                slap_mods_free( modlist );
@@ -409,10 +402,7 @@ slap_mods2entry(
        for( ; mods != NULL; mods = mods->sml_next ) {
                Attribute *attr;
 
-#ifdef LDAP_SYNCREPL
-               if ( !repl_user )
-#endif
-               {
+               if ( !repl_user ) {
                        assert( mods->sml_op == LDAP_MOD_ADD );
                }
                assert( mods->sml_desc != NULL );
index 9877210970915591fa09ae9df0a02766b0bc2538..af30412f1f4f6a5292769e2e140fa8117cd62d1b 100644 (file)
@@ -35,13 +35,11 @@ bdb_add(Operation *op, SlapReply *rs )
 
        int             num_retries = 0;
 
-#ifdef LDAP_SYNC
        Operation* ps_list;
        int             rc;
        EntryInfo       *suffix_ei;
        Entry           *ctxcsn_e;
        int                     ctxcsn_added = 0;
-#endif
 
 #ifdef NEW_LOGGING
        LDAP_LOG ( OPERATION, ARGS, "==> bdb_add: %s\n", op->oq_add.rs_e->e_name.bv_val, 0, 0 );
@@ -317,11 +315,7 @@ retry:     /* transaction retry */
                                        rs->sr_text = "no write access to parent";
                                        goto return_results;
                                }
-#ifdef LDAP_SYNCREPL
                        } else if ( !is_entry_glue( op->oq_add.rs_e )) {
-#else
-                       } else {
-#endif
 #ifdef NEW_LOGGING
                                LDAP_LOG ( OPERATION, DETAIL1, "bdb_add: %s denied\n", 
                                        pdn.bv_len == 0 ? "suffix" : "entry at root", 0, 0 );
@@ -470,11 +464,7 @@ retry:     /* transaction retry */
                goto return_results;
        }
 
-#ifdef LDAP_SYNCREPL
-       if ( !op->o_bd->syncinfo )
-#endif
-#ifdef LDAP_SYNC
-       {
+       if ( !op->o_bd->syncinfo ) {
                rc = bdb_csn_commit( op, rs, ltid, ei, &suffix_ei, &ctxcsn_e, &ctxcsn_added, locker );
                switch ( rc ) {
                case BDB_CSN_ABORT :
@@ -483,7 +473,6 @@ retry:      /* transaction retry */
                        goto retry;
                }
        }
-#endif
 
        if ( op->o_noop ) {
                if (( rs->sr_err=TXN_ABORT( ltid )) != 0 ) {
@@ -504,9 +493,7 @@ retry:      /* transaction retry */
 
                } else {
                        struct berval nrdn;
-#ifdef LDAP_SYNC
                        struct berval ctx_nrdn;
-#endif
 
                        if (pdn.bv_len) {
                                nrdn.bv_val = op->ora_e->e_nname.bv_val;
@@ -517,18 +504,13 @@ retry:    /* transaction retry */
 
                        bdb_cache_add( bdb, ei, op->oq_add.rs_e, &nrdn, locker );
 
-#ifdef LDAP_SYNCREPL
-                       if ( !op->o_bd->syncinfo )
-#endif
-#ifdef LDAP_SYNC
-                       {
+                       if ( !op->o_bd->syncinfo ) {
                                if ( ctxcsn_added ) {
                                        ctx_nrdn.bv_val = "cn=ldapsync";
                                        ctx_nrdn.bv_len = strlen( ctx_nrdn.bv_val );
                                        bdb_cache_add( bdb, suffix_ei, ctxcsn_e, &ctx_nrdn, locker );
                                }
                        }
-#endif
 
                        if(( rs->sr_err=TXN_COMMIT( ltid, 0 )) != 0 ) {
                                rs->sr_text = "txn_commit failed";
@@ -566,13 +548,11 @@ retry:    /* transaction retry */
 return_results:
        send_ldap_result( op, rs );
 
-#ifdef LDAP_SYNC
        if ( rs->sr_err == LDAP_SUCCESS && !noop ) {
                LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
                        bdb_psearch( op, rs, ps_list, op->oq_add.rs_e, LDAP_PSEARCH_BY_ADD );
                }
        }
-#endif
 
        if( rs->sr_err == LDAP_SUCCESS && bdb->bi_txn_cp ) {
                ldap_pvt_thread_yield();
index d8880b314767addc78ce4930f58f8247b1d5eb7c..93356b13b5860fc95ee2880f55ace0fa515e6abe 100644 (file)
@@ -14,9 +14,7 @@
 
 LDAP_BEGIN_DECL
 
-#ifdef LDAP_SYNCREPL
 #define BDB_SUBENTRIES 1
-#endif
 
 #define DN_BASE_PREFIX         SLAP_INDEX_EQUALITY_PREFIX
 #define DN_ONE_PREFIX          '%'
@@ -158,9 +156,7 @@ struct bdb_info {
 
        ID                      bi_lastid;
        ldap_pvt_thread_mutex_t bi_lastid_mutex;
-#ifdef LDAP_SYNC
        LDAP_LIST_HEAD(pl, slap_op) bi_psearch_list;
-#endif
 #ifdef SLAP_IDL_CACHE
        int             bi_idl_cache_max_size;
        int             bi_idl_cache_size;
@@ -223,11 +219,9 @@ struct bdb_op_info {
 
 #define BDB_REUSE_LOCKERS
 
-#ifdef LDAP_SYNC
 #define BDB_CSN_COMMIT 0
 #define BDB_CSN_ABORT  1
 #define BDB_CSN_RETRY  2
-#endif
 
 LDAP_END_DECL
 
index a55dcf0870b9a1615fe3de42260bf3217010ea61..c9f17b6493a39aba089bc7b27aa3478050d9ca24 100644 (file)
@@ -34,11 +34,7 @@ bdb_cache_entryinfo_new( )
 }
 
 /* Atomically release and reacquire a lock */
-#if LDAP_SYNC
 int
-#else
-static int
-#endif
 bdb_cache_entry_db_relock(
        DB_ENV *env,
        u_int32_t locker,
index 44f3d003ec65912d5552d18aeed1dd6085978266..7ca71a0f012d4f1c78cdf79e304cc775a322423b 100644 (file)
@@ -30,7 +30,6 @@
 #include "back-bdb.h"
 #include "external.h"
 
-#ifdef LDAP_SYNC
 int
 bdb_csn_commit(
        Operation *op,
@@ -201,4 +200,3 @@ rewind :
        slap_rewind_commit_csn( op );
        return BDB_CSN_RETRY;
 }
-#endif
index db013e6a85fa86fa55e33272b35913b93347356d..2c7316f3d354da3b346152bee71a64b671084223 100644 (file)
@@ -35,13 +35,11 @@ bdb_delete( Operation *op, SlapReply *rs )
 
        int             num_retries = 0;
 
-#ifdef LDAP_SYNC
        Operation* ps_list;
        int     rc;
        EntryInfo   *suffix_ei;
        Entry       *ctxcsn_e;
        int         ctxcsn_added = 0;
-#endif
 
 #ifdef NEW_LOGGING
        LDAP_LOG ( OPERATION, ARGS,  "==> bdb_delete: %s\n", op->o_req_dn.bv_val, 0, 0 );
@@ -230,11 +228,8 @@ retry:     /* transaction retry */
                }
        }
 
-#ifdef LDAP_SYNCREPL /* FIXME : dn2entry() should return non-glue entry */
+       /* FIXME : dn2entry() should return non-glue entry */
        if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) {
-#else
-       if ( e == NULL ) {
-#endif
 #ifdef NEW_LOGGING
                LDAP_LOG ( OPERATION, ARGS, 
                        "<=- bdb_delete: no such object %s\n", op->o_req_dn.bv_val, 0, 0);
@@ -253,12 +248,8 @@ retry:     /* transaction retry */
                        matched = NULL;
 
                } else {
-#ifdef LDAP_SYNCREPL
                        BerVarray deref = op->o_bd->syncinfo ?
                                                          op->o_bd->syncinfo->provideruri_bv : default_referral;
-#else
-                       BerVarray deref = default_referral;
-#endif
                        rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
                }
 
@@ -460,11 +451,7 @@ retry:     /* transaction retry */
        ldap_pvt_thread_mutex_unlock( &bdb->bi_lastid_mutex );
 #endif
 
-#ifdef LDAP_SYNCREPL
-       if ( !op->o_bd->syncinfo )
-#endif
-#ifdef LDAP_SYNC
-       {
+       if ( !op->o_bd->syncinfo ) {
                rc = bdb_csn_commit( op, rs, ltid, ei, &suffix_ei, &ctxcsn_e, &ctxcsn_added, locker );
                switch ( rc ) {
                case BDB_CSN_ABORT :
@@ -473,7 +460,6 @@ retry:      /* transaction retry */
                        goto retry;
                }
        }
-#endif
 
        if( op->o_noop ) {
                if ( ( rs->sr_err = TXN_ABORT( ltid ) ) != 0 ) {
@@ -483,25 +469,18 @@ retry:    /* transaction retry */
                        rs->sr_err = LDAP_SUCCESS;
                }
        } else {
-#ifdef LDAP_SYNC
                struct berval ctx_nrdn;
-#endif
 
                bdb_cache_delete( &bdb->bi_cache, e, bdb->bi_dbenv,
                        locker, &lock );
 
-#ifdef LDAP_SYNCREPL
-               if ( !op->o_bd->syncinfo )
-#endif
-#ifdef LDAP_SYNC
-               {
+               if ( !op->o_bd->syncinfo ) {
                        if ( ctxcsn_added ) {
                                ctx_nrdn.bv_val = "cn=ldapsync";
                                ctx_nrdn.bv_len = strlen( ctx_nrdn.bv_val );
                                bdb_cache_add( bdb, suffix_ei, ctxcsn_e, &ctx_nrdn, locker );
                        }
                }
-#endif
 
                rs->sr_err = TXN_COMMIT( ltid, 0 );
        }
@@ -540,13 +519,11 @@ retry:    /* transaction retry */
 return_results:
        send_ldap_result( op, rs );
 
-#ifdef LDAP_SYNC
        if ( rs->sr_err == LDAP_SUCCESS && !noop ) {
                LDAP_LIST_FOREACH( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
                        bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_DELETE );
                }
        }
-#endif
 
        if(rs->sr_err == LDAP_SUCCESS && bdb->bi_txn_cp ) {
                ldap_pvt_thread_yield();
index 0ab747ac7c9e3e8bfe1f73136dd4c5c0310d2429..7d57e497d09367cf1fd304495aff35bc09e3c77e 100644 (file)
@@ -91,9 +91,7 @@ bdb_db_init( BackendDB *be )
        bdb->bi_search_stack_depth = DEFAULT_SEARCH_STACK_DEPTH;
        bdb->bi_search_stack = NULL;
 
-#ifdef LDAP_SYNC
        LDAP_LIST_INIT (&bdb->bi_psearch_list);
-#endif
 
        ldap_pvt_thread_mutex_init( &bdb->bi_lastid_mutex );
        ldap_pvt_thread_mutex_init( &bdb->bi_cache.lru_mutex );
@@ -674,13 +672,8 @@ bdb_initialize(
 
        bi->bi_op_unbind = 0;
 
-#ifdef LDAP_SYNC
        bi->bi_op_abandon = bdb_abandon;
        bi->bi_op_cancel = bdb_cancel;
-#else
-       bi->bi_op_abandon = 0;
-       bi->bi_op_cancel = 0;
-#endif
 
        bi->bi_extended = bdb_extended;
 
index a7ed134aefc6e81b3da408479a4304c5780fda6c..5f6d87e26e6e1d87e82738e4ced1f6a7b5028e2f 100644 (file)
@@ -328,14 +328,12 @@ bdb_modify( Operation *op, SlapReply *rs )
 
        int             num_retries = 0;
 
-#ifdef LDAP_SYNC
        Operation* ps_list;
        struct psid_entry *pm_list, *pm_prev;
        int rc;
        EntryInfo       *suffix_ei;
        Entry           *ctxcsn_e;
        int                     ctxcsn_added = 0;
-#endif
 
 #ifdef NEW_LOGGING
        LDAP_LOG ( OPERATION, ENTRY, "bdb_modify: %s\n", op->o_req_dn.bv_val, 0, 0 );
@@ -356,7 +354,6 @@ retry:      /* transaction retry */
                        "bdb_modify: retrying...\n", 0, 0, 0);
 #endif
 
-#ifdef LDAP_SYNC
                pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
                while ( pm_list != NULL ) {
                        LDAP_LIST_REMOVE ( pm_list, ps_link );
@@ -364,7 +361,6 @@ retry:      /* transaction retry */
                        pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
                        ch_free( pm_prev );
                }
-#endif
 
                rs->sr_err = TXN_ABORT( ltid );
                ltid = NULL;
@@ -437,11 +433,8 @@ retry:     /* transaction retry */
 
        e = ei->bei_e;
        /* acquire and lock entry */
-#ifdef LDAP_SYNCREPL /* FIXME: dn2entry() should return non-glue entry */
+       /* FIXME: dn2entry() should return non-glue entry */
        if (( rs->sr_err == DB_NOTFOUND ) || ( !manageDSAit && e && is_entry_glue( e ))) {
-#else
-       if ( rs->sr_err == DB_NOTFOUND ) {
-#endif
                if ( e != NULL ) {
                        rs->sr_matched = ch_strdup( e->e_dn );
                        rs->sr_ref = is_entry_referral( e )
@@ -451,12 +444,8 @@ retry:     /* transaction retry */
                        e = NULL;
 
                } else {
-#ifdef LDAP_SYNCREPL
                        BerVarray deref = op->o_bd->syncinfo ?
                                                          op->o_bd->syncinfo->provideruri_bv : default_referral;
-#else
-                       BerVarray deref = default_referral;
-#endif
                        rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
                }
 
@@ -500,13 +489,11 @@ retry:    /* transaction retry */
                goto return_results;
        }
 
-#ifdef LDAP_SYNC
        if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) {
                LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
                        bdb_psearch(op, rs, ps_list, e, LDAP_PSEARCH_BY_PREMODIFY );
                }
        }
-#endif
 
        /* nested transaction */
        rs->sr_err = TXN_BEGIN( bdb->bi_dbenv, ltid, &lt2, 
@@ -575,11 +562,7 @@ retry:     /* transaction retry */
                goto return_results;
        }
 
-#ifdef LDAP_SYNCREPL
-       if ( !op->o_bd->syncinfo )
-#endif
-#ifdef LDAP_SYNC
-       {
+       if ( !op->o_bd->syncinfo ) {
                rc = bdb_csn_commit( op, rs, ltid, ei, &suffix_ei, &ctxcsn_e, &ctxcsn_added, locker );
                switch ( rc ) {
                case BDB_CSN_ABORT :
@@ -588,7 +571,6 @@ retry:      /* transaction retry */
                        goto retry;
                }
        }
-#endif
 
        if( op->o_noop ) {
                if ( ( rs->sr_err = TXN_ABORT( ltid ) ) != 0 ) {
@@ -598,24 +580,18 @@ retry:    /* transaction retry */
                        rs->sr_err = LDAP_SUCCESS;
                }
        } else {
-#ifdef LDAP_SYNC
                struct berval ctx_nrdn;
                EntryInfo *ctx_ei;
-#endif
+
                bdb_cache_modify( e, dummy.e_attrs, bdb->bi_dbenv, locker, &lock );
 
-#ifdef LDAP_SYNCREPL
-               if ( !op->o_bd->syncinfo )
-#endif
-#ifdef LDAP_SYNC
-               {
+               if ( !op->o_bd->syncinfo ) {
                        if ( ctxcsn_added ) {
                                ctx_nrdn.bv_val = "cn=ldapsync";
                                ctx_nrdn.bv_len = strlen( ctx_nrdn.bv_val );
                                bdb_cache_add( bdb, suffix_ei, ctxcsn_e, &ctx_nrdn, locker );
                        }
                }
-#endif
 
                rs->sr_err = TXN_COMMIT( ltid, 0 );
        }
@@ -655,7 +631,6 @@ retry:      /* transaction retry */
 return_results:
        send_ldap_result( op, rs );
 
-#ifdef LDAP_SYNC
        if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) {
                /* Loop through in-scope entries for each psearch spec */
                LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
@@ -671,7 +646,6 @@ return_results:
                        ch_free( pm_prev );
                }
        }
-#endif
 
        if( rs->sr_err == LDAP_SUCCESS && bdb->bi_txn_cp ) {
                ldap_pvt_thread_yield();
@@ -681,7 +655,6 @@ return_results:
 
 done:
        if( ltid != NULL ) {
-#ifdef LDAP_SYNC
                pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
                while ( pm_list != NULL ) {
                        LDAP_LIST_REMOVE ( pm_list, ps_link );
@@ -689,7 +662,6 @@ done:
                        pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
                        ch_free( pm_prev );
                }
-#endif
                TXN_ABORT( ltid );
                op->o_private = NULL;
        }
index b158ed7f425518e1bd08469c9c8fb42bae306592..35fa4e966eaccf1dbd5e2a2c24903900cabfa646 100644 (file)
@@ -53,14 +53,12 @@ bdb_modrdn( Operation       *op, SlapReply *rs )
 
        int             num_retries = 0;
 
-#ifdef LDAP_SYNC
        Operation *ps_list;
        struct psid_entry *pm_list, *pm_prev;
        int     rc;
        EntryInfo       *suffix_ei;
        Entry           *ctxcsn_e;
        int                     ctxcsn_added = 0;
-#endif
 
 #ifdef NEW_LOGGING
        LDAP_LOG ( OPERATION, ENTRY, "==>bdb_modrdn(%s,%s,%s)\n", 
@@ -92,7 +90,6 @@ retry:        /* transaction retry */
                Debug( LDAP_DEBUG_TRACE, "==>bdb_modrdn: retrying...\n", 0, 0, 0 );
 #endif
 
-#ifdef LDAP_SYNC
                pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
                while ( pm_list != NULL ) {
                        LDAP_LIST_REMOVE ( pm_list, ps_link );
@@ -100,7 +97,6 @@ retry:       /* transaction retry */
                        pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
                        ch_free( pm_prev );
                }
-#endif
 
                rs->sr_err = TXN_ABORT( ltid );
                ltid = NULL;
@@ -164,11 +160,8 @@ retry:     /* transaction retry */
        }
 
        e = ei->bei_e;
-#ifdef LDAP_SYNCREPL /* FIXME: dn2entry() should return non-glue entry */
+       /* FIXME: dn2entry() should return non-glue entry */
        if (( rs->sr_err == DB_NOTFOUND ) || ( !manageDSAit && e && is_entry_glue( e ))) {
-#else
-       if ( rs->sr_err == DB_NOTFOUND ) {
-#endif
                if( e != NULL ) {
                        rs->sr_matched = ch_strdup( e->e_dn );
                        rs->sr_ref = is_entry_referral( e )
@@ -178,12 +171,8 @@ retry:     /* transaction retry */
                        e = NULL;
 
                } else {
-#ifdef LDAP_SYNCREPL
                        BerVarray deref = op->o_bd->syncinfo ?
                                                          op->o_bd->syncinfo->provideruri_bv : default_referral;
-#else
-                       BerVarray deref = default_referral;
-#endif
                        rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
                }
 
@@ -855,13 +844,11 @@ retry:    /* transaction retry */
                goto return_results;
        }
 
-#ifdef LDAP_SYNC
        if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) {
                LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
                        bdb_psearch( op, rs, ps_list, e, LDAP_PSEARCH_BY_PREMODIFY );
                }
        }
-#endif
 
        /* modify entry */
        rs->sr_err = bdb_modify_internal( op, lt2, &mod[0], e,
@@ -915,11 +902,7 @@ retry:     /* transaction retry */
                goto return_results;
        }
 
-#ifdef LDAP_SYNCREPL
-       if ( !op->o_bd->syncinfo )
-#endif
-#ifdef LDAP_SYNC
-       {
+       if ( !op->o_bd->syncinfo ) {
                rc = bdb_csn_commit( op, rs, ltid, ei, &suffix_ei, &ctxcsn_e, &ctxcsn_added, locker );
                switch ( rc ) {
                case BDB_CSN_ABORT :
@@ -928,7 +911,6 @@ retry:      /* transaction retry */
                        goto retry;
                }
        }
-#endif
 
        if( op->o_noop ) {
                if(( rs->sr_err=TXN_ABORT( ltid )) != 0 ) {
@@ -947,25 +929,18 @@ retry:    /* transaction retry */
                if(( rs->sr_err=TXN_PREPARE( ltid, gid )) != 0 ) {
                        rs->sr_text = "txn_prepare failed";
                } else {
-#ifdef LDAP_SYNC
                        struct berval ctx_nrdn;
-#endif
 
                        bdb_cache_modrdn( save, &op->orr_nnewrdn, e, neip,
                                bdb->bi_dbenv, locker, &lock );
 
-#ifdef LDAP_SYNCREPL
-                       if ( !op->o_bd->syncinfo )
-#endif
-#ifdef LDAP_SYNC
-                       {
+                       if ( !op->o_bd->syncinfo ) {
                                if ( ctxcsn_added ) {
                                        ctx_nrdn.bv_val = "cn=ldapsync";
                                        ctx_nrdn.bv_len = strlen( ctx_nrdn.bv_val );
                                        bdb_cache_add( bdb, suffix_ei, ctxcsn_e, &ctx_nrdn, locker );
                                }
                        }
-#endif
 
                        if(( rs->sr_err=TXN_COMMIT( ltid, 0 )) != 0 ) {
                                rs->sr_text = "txn_commit failed";
@@ -1003,7 +978,6 @@ retry:     /* transaction retry */
 return_results:
        send_ldap_result( op, rs );
 
-#ifdef LDAP_SYNC
        if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) {
                /* Loop through in-scope entries for each psearch spec */
                LDAP_LIST_FOREACH ( ps_list, &bdb->bi_psearch_list, o_ps_link ) {
@@ -1019,7 +993,6 @@ return_results:
                        ch_free( pm_prev );
                }
        }
-#endif
 
        if( rs->sr_err == LDAP_SUCCESS && bdb->bi_txn_cp ) {
                ldap_pvt_thread_yield();
@@ -1064,15 +1037,13 @@ done:
        }
 
        if( ltid != NULL ) {
-#ifdef LDAP_SYNC
-                pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
-                while ( pm_list != NULL ) {
-                        LDAP_LIST_REMOVE ( pm_list, ps_link );
+               pm_list = LDAP_LIST_FIRST(&op->o_pm_list);
+               while ( pm_list != NULL ) {
+                       LDAP_LIST_REMOVE ( pm_list, ps_link );
                        pm_prev = pm_list;
-                        pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
+                       pm_list = LDAP_LIST_NEXT ( pm_list, ps_link );
                        ch_free( pm_prev );
-                }
-#endif
+               }
                TXN_ABORT( ltid );
                op->o_private = NULL;
        }
index 528f3c4cb4c5fbf6ae819e7bffb0a191a4bfdb5a..c75aba915dbae6bd2091c394a8a20a86fef3938c 100644 (file)
@@ -173,12 +173,8 @@ retry:     /* transaction retry */
 
        if ( ei ) e = ei->bei_e;
 
-#ifdef LDAP_SYNCREPL
        if ( e == NULL || is_entry_glue( e )) {
                        /* FIXME: dn2entry() should return non-glue entry */
-#else
-       if ( e == NULL ) {
-#endif
                rs->sr_text = "could not locate authorization entry";
                rc = LDAP_NO_SUCH_OBJECT;
                goto done;
index a61522506a64cce553f4839041943af9fb938eff..18a5e304d79ec68b0a613c07cdc18a0a312d87b7 100644 (file)
@@ -477,7 +477,6 @@ void bdb_cache_delete_cleanup(
 );
 void bdb_cache_release_all( Cache *cache );
 
-#ifdef LDAP_SYNC
 #define bdb_cache_entry_db_relock              BDB_SYMBOL(cache_entry_db_relock)
 int bdb_cache_entry_db_relock(
        DB_ENV *env,
@@ -486,7 +485,6 @@ int bdb_cache_entry_db_relock(
        int rw,
        int tryOnly,
        DB_LOCK *lock );
-#endif
 
 #ifdef BDB_REUSE_LOCKERS
 
@@ -507,8 +505,6 @@ int bdb_locker_id( Operation *op, DB_ENV *env, int *locker );
  * search.c
  */
 
-#ifdef LDAP_SYNC
-
 #define bdb_abandon                                    BDB_SYMBOL(abandon)
 #define bdb_cancel                                     BDB_SYMBOL(cancel)
 #define bdb_do_search                          BDB_SYMBOL(do_search)
@@ -524,10 +520,7 @@ int bdb_do_search(
        int             psearch_type
 );
 #define        bdb_psearch(op, rs, sop, e, ps_type)    bdb_do_search(op, rs, sop, e, ps_type)
-#endif
 
-
-#ifdef LDAP_SYNC
 #define bdb_build_sync_state_ctrl      BDB_SYMBOL(build_sync_state_ctrl)
 #define bdb_build_sync_done_ctrl       BDB_SYMBOL(build_sync_done_ctrl)
 #define bdb_send_ldap_intermediate     BDB_SYMBOL(send_ldap_intermediate)
@@ -558,7 +551,6 @@ bdb_send_ldap_intermediate(
        SlapReply       *rs,
        int         state,
        struct berval *cookie );
-#endif
 
 /*
  * trans.c
index ed3606fe3260faccd720cfed46a9d20736967c7d..5fc72c5818c302a377ac7d0daeabfb1f450971d6 100644 (file)
@@ -280,18 +280,11 @@ nextido:
 static
 int is_sync_protocol( Operation *op )
 {
-#if !defined(LDAP_SYNC)
-       return 0;
-#endif
-
-#ifdef LDAP_SYNC
        if ( op->o_sync_mode & SLAP_SYNC_REFRESH_AND_PERSIST )
                return 1;
-#endif
        return 0;
 }
        
-#if defined(LDAP_SYNC)
 #define IS_BDB_REPLACE(type) (( type == LDAP_PSEARCH_BY_DELETE ) || \
        ( type == LDAP_PSEARCH_BY_SCOPEOUT ))
 #define IS_PSEARCH (op != sop)
@@ -359,11 +352,6 @@ int bdb_search( Operation *op, SlapReply *rs )
 int
 bdb_do_search( Operation *op, SlapReply *rs, Operation *sop,
        Entry *ps_e, int ps_type )
-#else
-#define        IS_PSEARCH      0
-#define        sop     op
-int bdb_search( Operation *op, SlapReply *rs )
-#endif
 {
        struct bdb_info *bdb = (struct bdb_info *) op->o_bd->be_private;
        time_t          stoptime;
@@ -379,7 +367,6 @@ int bdb_search( Operation *op, SlapReply *rs )
        ID              lastid = NOID;
        AttributeName   *attrs;
 
-#ifdef LDAP_SYNC
        Filter          contextcsnand, contextcsnle, cookief, csnfnot, csnfeq, csnfand, csnfge;
        Filter          omitcsnf, omitcsnfle;
        AttributeAssertion aa_ge, aa_eq, aa_le;
@@ -401,7 +388,6 @@ int bdb_search( Operation *op, SlapReply *rs )
        int             entry_sync_state = -1;
        AttributeName   null_attr;
        int             no_sync_state_change = 0;
-#endif
        struct slap_limits_set *limit = NULL;
        int isroot = 0;
 
@@ -416,7 +402,6 @@ int bdb_search( Operation *op, SlapReply *rs )
 #endif
        attrs = sop->oq_search.rs_attrs;
 
-#ifdef LDAP_SYNC
        /* psearch needs to be registered before refresh begins */
        /* psearch and refresh transmission is serialized in send_ldap_ber() */
        if ( !IS_PSEARCH && sop->o_sync_mode & SLAP_SYNC_PERSIST ) {
@@ -439,19 +424,15 @@ int bdb_search( Operation *op, SlapReply *rs )
                attrs[0].an_name.bv_len = 0;
                attrs[0].an_name.bv_val = NULL;
        }
-#endif
 
        manageDSAit = get_manageDSAit( sop );
 
        /* Sync control overrides manageDSAit */
 
-#ifdef LDAP_SYNC
        if ( !IS_PSEARCH && sop->o_sync_mode & SLAP_SYNC_REFRESH ) {
                if ( manageDSAit == SLAP_NO_CONTROL )
                        manageDSAit = SLAP_CRITICAL_CONTROL;
-       } else
-#endif
-       if ( IS_PSEARCH ) {
+       } else if ( IS_PSEARCH ) {
                if ( manageDSAit == SLAP_NO_CONTROL )
                        manageDSAit = SLAP_CRITICAL_CONTROL;
        }
@@ -680,17 +661,13 @@ dn2entry_retry:
        }
        e = NULL;
 
-#ifdef LDAP_SYNC
        if ( sop->o_sync_mode != SLAP_SYNC_NONE ) {
-#ifdef LDAP_SYNCREPL
                if ( sop->o_bd->syncinfo ) {
                        char substr[67];
                        sprintf( substr, "cn=syncrepl%d", sop->o_bd->syncinfo->id );
                        ber_str2bv( substr, strlen( substr ), 0, &ctxcsn_rdn );
                        build_new_dn( &ctxcsn_ndn, &op->o_bd->be_nsuffix[0], &ctxcsn_rdn );
-               } else
-#endif
-               {
+               } else {
                        ber_str2bv( "cn=ldapsync", strlen("cn=ldapsync"), 0, &ctxcsn_rdn );
                        build_new_dn( &ctxcsn_ndn, &op->o_bd->be_nsuffix[0], &ctxcsn_rdn );
                }
@@ -723,12 +700,9 @@ ctxcsn_retry :
                }
 
                if ( ctxcsn_e ) {
-#ifdef LDAP_SYNCREPL
                        if ( sop->o_bd->syncinfo ) {
                                csn_a = attr_find( ctxcsn_e->e_attrs, slap_schema.si_ad_syncreplCookie );
-                       } else
-#endif
-                       {
+                       } else {
                                csn_a = attr_find( ctxcsn_e->e_attrs, slap_schema.si_ad_contextCSN );
                        }
                        if ( csn_a ) {
@@ -740,7 +714,6 @@ ctxcsn_retry :
                        search_context_csn = NULL;
                }
        }
-#endif
 
        /* select candidates */
        if ( sop->oq_search.rs_scope == LDAP_SCOPE_BASE ) {
@@ -752,16 +725,13 @@ ctxcsn_retry :
                rs->sr_err = search_candidates( op, sop, rs, &base, locker, candidates, scopes );
        }
 
-#ifdef LDAP_SYNC
        if ( sop->o_sync_mode != SLAP_SYNC_NONE ) {
                bdb_cache_entry_db_unlock( bdb->bi_dbenv, &ctxcsn_lock );
        }
-#endif
 
        /* start cursor at beginning of candidates.
         */
        cursor = 0;
-#ifdef LDAP_SYNC
        if (IS_PSEARCH) {
                if ( !BDB_IDL_IS_RANGE( candidates ) ) {
                        cursor = bdb_idl_search( candidates, ps_e->e_id );
@@ -779,7 +749,6 @@ ctxcsn_retry :
                candidates[0] = 1;
                candidates[1] = ps_e->e_id;
        }
-#endif
 
        if ( candidates[0] == 0 ) {
 #ifdef NEW_LOGGING
@@ -844,7 +813,6 @@ ctxcsn_retry :
        }
 #endif
 
-#ifdef LDAP_SYNC
        if ( (sop->o_sync_mode & SLAP_SYNC_REFRESH) || IS_PSEARCH )
        {
                MatchingRule    *mr;
@@ -899,7 +867,6 @@ ctxcsn_retry :
                        csnfge.f_next = sop->oq_search.rs_filter;
                }
        }
-#endif
 
        for ( id = bdb_idl_first( candidates, &cursor );
                id != NOID;
@@ -934,9 +901,7 @@ loop_begin:
                }
 
 
-#ifdef LDAP_SYNC
                if (!IS_PSEARCH) {
-#endif
 id2entry_retry:
                        /* get the entry with reader lock */
                        ei = NULL;
@@ -976,11 +941,9 @@ id2entry_retry:
 
                                goto loop_continue;
                        }
-#ifdef LDAP_SYNC
                } else {
                        e = ps_e;
                }
-#endif
 
                rs->sr_entry = e;
 #ifdef BDB_SUBENTRIES
@@ -1117,14 +1080,11 @@ id2entry_retry:
                        goto loop_continue;
                }
 
-#ifdef LDAP_SYNCREPL
                if ( !manageDSAit && is_entry_glue( e )) {
                        goto loop_continue;
                }
-#endif
 
                /* if it matches the filter and scope, send it */
-#ifdef LDAP_SYNC
                if (IS_PSEARCH) {
                        if (ps_type != LDAP_PSEARCH_BY_SCOPEOUT) {
                                rs->sr_err = test_filter( sop, rs->sr_entry, &cookief );
@@ -1157,24 +1117,19 @@ id2entry_retry:
                                                entry_sync_state = LDAP_SYNC_PRESENT;
                                        }
                                }
-                       } else
-#endif
-                       {
+                       } else {
                                rs->sr_err = test_filter( sop,
                                        rs->sr_entry, sop->oq_search.rs_filter );
                        }
-#ifdef LDAP_SYNC
                }
-#endif
 
                if ( rs->sr_err == LDAP_COMPARE_TRUE ) {
                        /* check size limit */
                        if ( --sop->oq_search.rs_slimit == -1 ) {
-#ifdef LDAP_SYNC
-                               if (!IS_PSEARCH)
-#endif
-                               bdb_cache_return_entry_r( bdb->bi_dbenv,
-                                       &bdb->bi_cache, e, &lock );
+                               if (!IS_PSEARCH) {
+                                       bdb_cache_return_entry_r( bdb->bi_dbenv,
+                                               &bdb->bi_cache, e, &lock );
+                               }
                                e = NULL;
                                rs->sr_entry = NULL;
                                rs->sr_err = LDAP_SIZELIMIT_EXCEEDED;
@@ -1203,7 +1158,6 @@ id2entry_retry:
                                        result = 0;
                                } else
 #endif
-#ifdef LDAP_SYNC
                                if (IS_PSEARCH) {
                                        int premodify_found = 0;
                                        int entry_sync_state;
@@ -1283,9 +1237,7 @@ id2entry_retry:
                                                ch_free( ctrls[--num_ctrls] );
                                                ctrls[num_ctrls] = NULL;
                                                rs->sr_ctrls = NULL;
-                                       } else
-#endif
-                                       {
+                                       } else {
                                                rs->sr_attrs = sop->oq_search.rs_attrs;
                                                rs->sr_ctrls = NULL;
                                                result = send_search_entry( sop, rs );
@@ -1333,43 +1285,39 @@ loop_continue:
        }
 
        if (!IS_PSEARCH) {
-#ifdef LDAP_SYNC
-       if ( sop->o_sync_mode & SLAP_SYNC_REFRESH ) {
-               rs->sr_err = LDAP_SUCCESS;
-               rs->sr_rspoid = LDAP_SYNC_INFO;
-               rs->sr_ctrls = NULL;
-               bdb_send_ldap_intermediate( sop, rs,
-                       LDAP_SYNC_STATE_MODE_DONE, search_context_csn );
-
-               /* If changelog is supported, this is where to process it */
-
-               if ( sop->o_sync_mode & SLAP_SYNC_PERSIST ) {
-                       /* refreshAndPersist mode */
+               if ( sop->o_sync_mode & SLAP_SYNC_REFRESH ) {
+                       rs->sr_err = LDAP_SUCCESS;
+                       rs->sr_rspoid = LDAP_SYNC_INFO;
+                       rs->sr_ctrls = NULL;
                        bdb_send_ldap_intermediate( sop, rs,
-                               LDAP_SYNC_LOG_MODE_DONE, search_context_csn );
+                               LDAP_SYNC_STATE_MODE_DONE, search_context_csn );
+
+                       /* If changelog is supported, this is where to process it */
+       
+                       if ( sop->o_sync_mode & SLAP_SYNC_PERSIST ) {
+                               /* refreshAndPersist mode */
+                               bdb_send_ldap_intermediate( sop, rs,
+                                       LDAP_SYNC_LOG_MODE_DONE, search_context_csn );
+                       } else {
+                               /* refreshOnly mode */
+                               bdb_build_sync_done_ctrl( sop, rs, ctrls,
+                                       num_ctrls++, 1, search_context_csn );
+                               rs->sr_ctrls = ctrls;
+                               rs->sr_ref = rs->sr_v2ref;
+                               rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS : LDAP_REFERRAL;
+                               send_ldap_result( sop, rs );
+                               if ( ctrls[num_ctrls-1]->ldctl_value.bv_val != NULL ) {
+                                       ch_free( ctrls[num_ctrls-1]->ldctl_value.bv_val );
+                               }
+                               ch_free( ctrls[--num_ctrls] );
+                               ctrls[num_ctrls] = NULL;
+                       }
                } else {
-                       /* refreshOnly mode */
-                       bdb_build_sync_done_ctrl( sop, rs, ctrls,
-                               num_ctrls++, 1, search_context_csn );
-                       rs->sr_ctrls = ctrls;
+                       rs->sr_ctrls = NULL;
                        rs->sr_ref = rs->sr_v2ref;
                        rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS : LDAP_REFERRAL;
                        send_ldap_result( sop, rs );
-                       if ( ctrls[num_ctrls-1]->ldctl_value.bv_val != NULL ) {
-                               ch_free( ctrls[num_ctrls-1]->ldctl_value.bv_val );
-                       }
-                       ch_free( ctrls[--num_ctrls] );
-                       ctrls[num_ctrls] = NULL;
                }
-
-       } else
-#endif
-       {
-               rs->sr_ctrls = NULL;
-               rs->sr_ref = rs->sr_v2ref;
-               rs->sr_err = (rs->sr_v2ref == NULL) ? LDAP_SUCCESS : LDAP_REFERRAL;
-               send_ldap_result( sop, rs );
-       }
        }
 
        rs->sr_err = LDAP_SUCCESS;
@@ -1667,8 +1615,6 @@ done:
 }                      
 #endif
 
-#ifdef LDAP_SYNC
-#if 1
 int
 bdb_build_sync_state_ctrl(
        Operation       *op,
@@ -1734,102 +1680,6 @@ bdb_build_sync_state_ctrl(
 
        return LDAP_SUCCESS;
 }
-#else
-int
-bdb_build_sync_state_ctrl(
-       Operation       *op,
-       SlapReply       *rs,
-       Entry           *e,
-       int             entry_sync_state,
-       LDAPControl     **ctrls,
-       int             num_ctrls,
-       int             send_cookie,
-       struct berval   *latest_entrycsn_bv     )
-{
-       Attribute* a;
-       int ret;
-       int res;
-       const char *text = NULL;
-
-       char berbuf[LBER_ELEMENT_SIZEOF];
-       BerElement *ber = (BerElement *)berbuf;
-
-       struct berval entryuuid_bv      = { 0, NULL };
-       struct berval entrycsn_bv       = { 0, NULL };
-
-       ber_init2( ber, 0, LBER_USE_DER );
-
-       ctrls[num_ctrls] = ch_malloc ( sizeof ( LDAPControl ) );
-
-       for ( a = e->e_attrs; a != NULL; a = a->a_next ) {
-               AttributeDescription *desc = a->a_desc;
-               if ( desc == slap_schema.si_ad_entryCSN ) {
-                       ber_dupbv( &entrycsn_bv, &a->a_vals[0] );
-                       if ( latest_entrycsn_bv->bv_val == NULL ) {
-                               ber_dupbv( latest_entrycsn_bv, &entrycsn_bv );
-                       } else {
-                               res = value_match( &ret, desc,
-                                               desc->ad_type->sat_ordering, 0,
-                                               &entrycsn_bv, latest_entrycsn_bv, &text );
-                               if ( res != LDAP_SUCCESS ) {
-                                       ret = 0;
-#ifdef NEW_LOGGING
-                                       LDAP_LOG ( OPERATION, RESULTS,
-                                                       "bdb_search: value_match failed\n",
-                                                       0, 0, 0 );
-#else
-                                       Debug( LDAP_DEBUG_TRACE,
-                                                       "bdb_search: value_match failed\n",
-                                                       0, 0, 0 );
-#endif
-                               }
-                               if ( ret > 0 ) {
-                                       ch_free( latest_entrycsn_bv->bv_val );
-                                       latest_entrycsn_bv->bv_val = NULL;
-                                       ber_dupbv( latest_entrycsn_bv, &entrycsn_bv );
-                               }
-                       }
-               } else if ( desc == slap_schema.si_ad_entryUUID ) {
-                       ber_dupbv( &entryuuid_bv, &a->a_vals[0] );
-               }
-       }
-
-       if ( send_cookie ) {
-               ber_printf( ber, "{eOON}",
-                       entry_sync_state, &entryuuid_bv, &entrycsn_bv );
-       } else {
-               ber_printf( ber, "{eON}",
-                       entry_sync_state, &entryuuid_bv );
-       }
-
-       ch_free( entrycsn_bv.bv_val );
-       entrycsn_bv.bv_val = NULL;
-       ch_free( entryuuid_bv.bv_val );
-       entryuuid_bv.bv_val = NULL;
-
-       ctrls[num_ctrls]->ldctl_oid = LDAP_CONTROL_SYNC_STATE;
-       ctrls[num_ctrls]->ldctl_iscritical = op->o_sync;
-       ret = ber_flatten2( ber, &ctrls[num_ctrls]->ldctl_value, 1 );
-
-       ber_free_buf( ber );
-
-       if ( ret < 0 ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG ( OPERATION, RESULTS, 
-                       "bdb_build_sync_ctrl: ber_flatten2 failed\n",
-                       0, 0, 0 );
-#else
-               Debug( LDAP_DEBUG_TRACE,
-                       "bdb_build_sync_ctrl: ber_flatten2 failed\n",
-                       0, 0, 0 );
-#endif
-               send_ldap_error( op, rs, LDAP_OTHER, "internal error" );
-               return ret;
-       }
-
-       return LDAP_SUCCESS;
-}
-#endif
 
 int
 bdb_build_sync_done_ctrl(
@@ -1921,4 +1771,3 @@ bdb_send_ldap_intermediate(
 
        return LDAP_SUCCESS;
 }
-#endif
index 8e6b560302ea10623b6efd2a1e589b7d4a5c078f..7406a93d7e8bcfd5abb8a7230f24d343c765c859 100644 (file)
@@ -51,11 +51,7 @@ ldbm_back_add(
 #endif
 
                send_ldap_result( op, rs );
-#ifdef LDAP_SYNCREPL
                return rs->sr_err;
-#else
-               return( -1 );
-#endif
        }
 
 #ifdef LDBM_SUBENTRIES
@@ -77,11 +73,7 @@ ldbm_back_add(
                send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS,
                    "no write access to entry" );
 
-#ifdef LDAP_SYNCREPL
                return LDAP_INSUFFICIENT_ACCESS;
-#else
-               return -1;
-#endif
        }
 
        /* grab giant lock for writing */
@@ -92,11 +84,7 @@ ldbm_back_add(
                ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
                rs->sr_err = rs->sr_err ? LDAP_OTHER : LDAP_ALREADY_EXISTS;
                send_ldap_result( op, rs );
-#ifdef LDAP_SYNCREPL
                return rs->sr_err;
-#else
-               return( -1 );
-#endif
        }
 
        /*
@@ -147,11 +135,7 @@ ldbm_back_add(
                        ber_bvarray_free( rs->sr_ref );
                        free( (char *)rs->sr_matched );
 
-#ifdef LDAP_SYNCREPL
                        return rs->sr_err;
-#else
-                       return -1;
-#endif
                }
 
                if ( ! access_allowed( op, p,
@@ -173,11 +157,7 @@ ldbm_back_add(
                        send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS,
                            "no write access to parent" );
 
-#ifdef LDAP_SYNCREPL
                        return LDAP_INSUFFICIENT_ACCESS;
-#else
-                       return -1;
-#endif
                }
 
 #ifdef LDBM_SUBENTRIES
@@ -214,11 +194,7 @@ ldbm_back_add(
                        send_ldap_error( op, rs, LDAP_ALIAS_PROBLEM,
                            "parent is an alias" );
 
-#ifdef LDAP_SYNCREPL
                        return LDAP_ALIAS_PROBLEM;
-#else
-                       return -1;
-#endif
                }
 
                if ( is_entry_referral( p ) ) {
@@ -244,11 +220,7 @@ ldbm_back_add(
 
                        ber_bvarray_free( rs->sr_ref );
                        free( (char *)rs->sr_matched );
-#ifdef LDAP_SYNCREPL
                        return rs->sr_err;
-#else
-                       return -1;
-#endif
                }
 
 #ifdef LDBM_SUBENTRIES
@@ -291,17 +263,9 @@ ldbm_back_add(
                                                LDAP_INSUFFICIENT_ACCESS,
                                                "no write access to parent" );
 
-#ifdef LDAP_SYNCREPL
                                        return LDAP_INSUFFICIENT_ACCESS;
-#else
-                                       return -1;
-#endif
                                }
-#ifdef LDAP_SYNCREPL
                        } else if ( !is_entry_glue( op->oq_add.rs_e )) {
-#else
-                       } else {
-#endif
                                ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
 
 #ifdef NEW_LOGGING
@@ -318,11 +282,7 @@ ldbm_back_add(
                                send_ldap_error( op, rs,
                                                LDAP_NO_SUCH_OBJECT, NULL );
 
-#ifdef LDAP_SYNCREPL
                                        return LDAP_NO_SUCH_OBJECT;
-#else
-                                       return -1;
-#endif
                        }
                }
 
@@ -362,11 +322,7 @@ ldbm_back_add(
                send_ldap_error( op, rs, LDAP_OTHER,
                        "next_id add failed" );
 
-#ifdef LDAP_SYNCREPL
                return LDAP_OTHER;
-#else
-               return( -1 );
-#endif
        }
 
        /*
@@ -394,11 +350,7 @@ ldbm_back_add(
                rs->sr_err = rs->sr_err > 0 ? LDAP_ALREADY_EXISTS : LDAP_OTHER;
                send_ldap_result( op, rs );
 
-#ifdef LDAP_SYNCREPL
                return rs->sr_err;
-#else
-               return( -1 );
-#endif
        }
 
        rs->sr_err = -1;
index 0b206a6e4ef12ba790508c2d92c4e14f55b1283b..669f80793dd2cd2e0c84425b4f43bdc85d1728af 100644 (file)
@@ -12,9 +12,7 @@
 
 LDAP_BEGIN_DECL
 
-#ifdef LDAP_SYNCREPL
 #define LDBM_SUBENTRIES 1
-#endif
 
 #define DEFAULT_CACHE_SIZE     1000
 
index 5474baf0bfe835c395c6f4c6131ac2fb710bcb5f..73ab8217d1874b788942a36550c105550eb59b3f 100644 (file)
@@ -81,11 +81,7 @@ ldbm_back_bind(
 
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
                if ( rs->sr_matched ) free( (char *)rs->sr_matched );
-#ifdef LDAP_SYNCREPL
                return rs->sr_err;
-#else
-               return( rc );
-#endif
        }
 
        ber_dupbv( &op->oq_bind.rb_edn, &e->e_name );
@@ -103,11 +99,7 @@ ldbm_back_bind(
 #endif
                rs->sr_err = LDAP_INVALID_CREDENTIALS;
                send_ldap_result( op, rs );
-#ifdef LDAP_SYNCREPL
                rc = LDAP_INVALID_CREDENTIALS;
-#else
-               rc = 1;
-#endif
                goto return_results;
        }
 #endif
@@ -126,11 +118,7 @@ ldbm_back_bind(
                send_ldap_error( op, rs, LDAP_ALIAS_PROBLEM,
                    "entry is alias" );
 
-#ifdef LDAP_SYNCREPL
                rc = LDAP_ALIAS_PROBLEM;
-#else
-               rc = 1;
-#endif
                goto return_results;
        }
 
@@ -158,11 +146,7 @@ ldbm_back_bind(
 
                ber_bvarray_free( rs->sr_ref );
 
-#ifdef LDAP_SYNCREPL
                rc = rs->sr_err;
-#else
-               rc = 1;
-#endif
                goto return_results;
        }
 
@@ -172,11 +156,7 @@ ldbm_back_bind(
                        password, NULL, ACL_AUTH, NULL ) )
                {
                        send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS, NULL );
-#ifdef LDAP_SYNCREPL
                        rc = LDAP_INSUFFICIENT_ACCESS;
-#else
-                       rc = 1;
-#endif
                        goto return_results;
                }
 
@@ -184,22 +164,14 @@ ldbm_back_bind(
                        send_ldap_error( op, rs, LDAP_INAPPROPRIATE_AUTH, NULL );
 
                        /* stop front end from sending result */
-#ifdef LDAP_SYNCREPL
                        rc = LDAP_INAPPROPRIATE_AUTH;
-#else
-                       rc = 1;
-#endif
                        goto return_results;
                }
 
                if ( slap_passwd_check( op->o_conn, a, &op->oq_bind.rb_cred, &rs->sr_text ) != 0 ) {
                        send_ldap_error( op, rs, LDAP_INVALID_CREDENTIALS, NULL );
                        /* stop front end from sending result */
-#ifdef LDAP_SYNCREPL
                        rc = LDAP_INVALID_CREDENTIALS;
-#else
-                       rc = 1;
-#endif
                        goto return_results;
                }
 
@@ -210,11 +182,7 @@ ldbm_back_bind(
        case LDAP_AUTH_KRBV41:
                if ( krbv4_ldap_auth( op->o_bd, &op->oq_bind.rb_cred, &ad ) != LDAP_SUCCESS ) {
                        send_ldap_error( op, rs, LDAP_INVALID_CREDENTIALS, NULL );
-#ifdef LDAP_SYNCREPL
                        rc = LDAP_INVALID_CREDENTIALS;
-#else
-                       rc = 1;
-#endif
                        goto return_results;
                }
 
@@ -223,11 +191,7 @@ ldbm_back_bind(
                {
                        send_ldap_error( op, rs, LDAP_INSUFFICIENT_ACCESS,
                                NULL );
-#ifdef LDAP_SYNCREPL
                        rc = LDAP_INSUFFICIENT_ACCESS;
-#else
-                       rc = 1;
-#endif
                        goto return_results;
                }
 
@@ -243,11 +207,7 @@ ldbm_back_bind(
                                break;
                        }
                        send_ldap_error( op, rs, LDAP_INAPPROPRIATE_AUTH, NULL );
-#ifdef LDAP_SYNCREPL
                        rc = LDAP_INAPPROPRIATE_AUTH;
-#else
-                       rc = 1;
-#endif
                        goto return_results;
 
                } else {        /* look for krbname match */
@@ -259,11 +219,7 @@ ldbm_back_bind(
                        if ( value_find( a->a_desc, a->a_vals, &krbval ) != 0 ) {
                                send_ldap_error( op, rs,
                                    LDAP_INVALID_CREDENTIALS, NULL );
-#ifdef LDAP_SYNCREPL
                                rc = LDAP_INVALID_CREDENTIALS;
-#else
-                               rc = 1;
-#endif
                                goto return_results;
                        }
                }
@@ -281,11 +237,7 @@ ldbm_back_bind(
        default:
                send_ldap_error( op, rs, LDAP_STRONG_AUTH_NOT_SUPPORTED,
                    "authentication method not supported" );
-#ifdef LDAP_SYNCREPL
                rc = LDAP_STRONG_AUTH_NOT_SUPPORTED;
-#else
-               rc = 1;
-#endif
                goto return_results;
        }
 
index 2cf8bfa91219c735c015628b3d7d05524125e374..73ce46668331250d936225a972ebdf7e5cbcacc4 100644 (file)
@@ -42,11 +42,8 @@ ldbm_back_delete(
        /* get entry with writer lock */
        e = dn2entry_w( op->o_bd, &op->o_req_ndn, &matched );
 
-#ifdef LDAP_SYNCREPL /* FIXME : dn2entry() should return non-glue entry */
+       /* FIXME : dn2entry() should return non-glue entry */
        if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) {
-#else
-       if ( e == NULL ) {
-#endif
 #ifdef NEW_LOGGING
                LDAP_LOG( BACK_LDBM, INFO, 
                        "ldbm_back_delete: no such object %s\n", op->o_req_dn.bv_val, 0, 0 );
@@ -63,12 +60,8 @@ ldbm_back_delete(
                        cache_return_entry_r( &li->li_cache, matched );
 
                } else {
-#ifdef LDAP_SYNCREPL
                        BerVarray deref = op->o_bd->syncinfo ?
                                                          op->o_bd->syncinfo->provideruri_bv : default_referral;
-#else
-                       BerVarray deref = default_referral;
-#endif
                        rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
                }
 
index a729fc3172d478551c3d0776e7f574794e1d28fd..1e78935a79e4d5d7c3e58a4bc03d67c7520a2c58 100644 (file)
@@ -314,11 +314,8 @@ ldbm_back_modify(
        /* acquire and lock entry */
        e = dn2entry_w( op->o_bd, &op->o_req_ndn, &matched );
 
-#ifdef LDAP_SYNCREPL /* FIXME: dn2entry() should return non-glue entry */
+       /* FIXME: dn2entry() should return non-glue entry */
        if (( e == NULL ) || ( !manageDSAit && e && is_entry_glue( e ))) {
-#else
-       if ( e == NULL ) {
-#endif
                if ( matched != NULL ) {
                        rs->sr_matched = ch_strdup( matched->e_dn );
                        rs->sr_ref = is_entry_referral( matched )
@@ -326,12 +323,8 @@ ldbm_back_modify(
                                : NULL;
                        cache_return_entry_r( &li->li_cache, matched );
                } else {
-#ifdef LDAP_SYNCREPL
                        BerVarray deref = op->o_bd->syncinfo ?
                                                          op->o_bd->syncinfo->provideruri_bv : default_referral;
-#else
-                       BerVarray deref = default_referral;
-#endif
                        rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
                }
 
@@ -342,11 +335,7 @@ ldbm_back_modify(
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
                free( (char *)rs->sr_matched );
 
-#ifdef LDAP_SYNCREPL
                return rs->sr_err;
-#else
-               return( -1 );
-#endif
        }
 
        if ( !manageDSAit && is_entry_referral( e ) )
@@ -403,9 +392,5 @@ ldbm_back_modify(
 error_return:;
        cache_return_entry_w( &li->li_cache, e );
        ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
-#ifdef LDAP_SYNCREPL
        return rs->sr_err;
-#else
-       return( -1 );
-#endif
 }
index b739afc6182b97b027d089129db57d71a2426862..7200a7bc481abc49912a64fac339e0bc56a20df4 100644 (file)
@@ -83,11 +83,8 @@ ldbm_back_modrdn(
        e = dn2entry_w( op->o_bd, &op->o_req_ndn, &matched );
 
        /* get entry with writer lock */
-#ifdef LDAP_SYNCREPL /* FIXME: dn2entry() should return non-glue entry */
+       /* FIXME: dn2entry() should return non-glue entry */
        if (( e == NULL  ) || ( !manageDSAit && e && is_entry_glue( e ))) {
-#else
-       if ( e == NULL ) {
-#endif
                if ( matched != NULL ) {
                        rs->sr_matched = strdup( matched->e_dn );
                        rs->sr_ref = is_entry_referral( matched )
@@ -95,12 +92,8 @@ ldbm_back_modrdn(
                                : NULL;
                        cache_return_entry_r( &li->li_cache, matched );
                } else {
-#ifdef LDAP_SYNCREPL
                        BerVarray deref = op->o_bd->syncinfo ?
                                                          op->o_bd->syncinfo->provideruri_bv : default_referral;
-#else
-                       BerVarray deref = default_referral;
-#endif
                        rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn, LDAP_SCOPE_DEFAULT );
                }
 
@@ -112,11 +105,7 @@ ldbm_back_modrdn(
                if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
                free( (char *)rs->sr_matched );
 
-#ifdef LDAP_SYNCREPL
                return rs->sr_err;
-#else
-               return( -1 );
-#endif
        }
 
        /* check entry for "entry" acl */
index 5e7bde2932fb365cb5ca5d19f2e629676cda34da..18e8920f25b796c185972f503b951f6682f297bc 100644 (file)
@@ -103,12 +103,8 @@ ldbm_back_exop_passwd(
 
        e = dn2entry_w( op->o_bd, &ndn, NULL );
 
-#ifdef LDAP_SYNCREPL
        if ( e == NULL || is_entry_glue( e )) {
-                       /* FIXME : dn2entry() should return non-glue entry */
-#else
-       if( e == NULL ) {
-#endif
+               /* FIXME : dn2entry() should return non-glue entry */
                ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
                rs->sr_text = "could not locate authorization entry";
                rc = LDAP_NO_SUCH_OBJECT;
index 8c09b37331e7e939216cde6fb16698fd6ec65e83..5b822d5c74aa17fa399c9d801502d43c4559f186 100644 (file)
@@ -115,11 +115,7 @@ ldbm_back_search(
 
                ber_bvarray_free( rs->sr_ref );
                ber_memfree( matched_dn.bv_val );
-#ifdef LDAP_SYNCREPL
                return LDAP_REFERRAL;
-#else
-               return 1;
-#endif
        }
 
        if (!manageDSAit && is_entry_referral( e ) ) {
@@ -163,11 +159,7 @@ ldbm_back_search(
                }
 
                ber_memfree( matched_dn.bv_val );
-#ifdef LDAP_SYNCREPL
                return LDAP_OTHER;
-#else
-               return 1;
-#endif
        }
 
        if ( is_entry_alias( e ) ) {
@@ -205,11 +197,7 @@ searchit:
                rs->sr_err = LDAP_SUCCESS;
                send_ldap_result( op, rs );
 
-#ifdef LDAP_SYNCREPL
                rc = LDAP_OTHER;
-#else
-               rc = 1;
-#endif
                goto done;
        }
 
@@ -454,11 +442,9 @@ searchit:
                        goto loop_continue;
                }
 
-#ifdef LDAP_SYNCREPL
                if ( !manageDSAit && is_entry_glue( e )) {
                        goto loop_continue;
                }
-#endif
 
                /* if it matches the filter and scope, send it */
                result = test_filter( op, e, op->oq_search.rs_filter );
index b6d80bec5c61c04b152eeaaecdd22203cb08f3b1..be24c8189b9df0587603b4a8574df16416faed01 100644 (file)
@@ -128,18 +128,14 @@ BackendInfo       *backendInfo = NULL;
 int                    nBackendDB = 0; 
 BackendDB      *backendDB = NULL;
 
-#ifdef LDAP_SYNCREPL
 ldap_pvt_thread_pool_t syncrepl_pool;
 int                    syncrepl_pool_max = SLAP_MAX_SYNCREPL_THREADS;
-#endif
 
 int backend_init(void)
 {
        int rc = -1;
 
-#ifdef LDAP_SYNCREPL
        ldap_pvt_thread_pool_init( &syncrepl_pool, syncrepl_pool_max, 0 );
-#endif
 
        if((nBackendInfo != 0) || (backendInfo != NULL)) {
                /* already initialized */
@@ -248,9 +244,7 @@ int backend_startup(Backend *be)
        int i;
        int rc = 0;
 
-#ifdef LDAP_SYNCREPL
        init_syncrepl();
-#endif
 
        if( ! ( nBackendDB > 0 ) ) {
                /* no databases */
@@ -268,9 +262,7 @@ int backend_startup(Backend *be)
        if(be != NULL) {
                /* startup a specific backend database */
 
-#ifdef LDAP_SYNC
                LDAP_TAILQ_INIT( &be->be_pending_csn_list );
-#endif
 
 #ifdef NEW_LOGGING
                LDAP_LOG( BACKEND, DETAIL1, "backend_startup:  starting \"%s\"\n",
@@ -338,20 +330,16 @@ int backend_startup(Backend *be)
                }
        }
 
-#ifdef LDAP_SYNCREPL
        ldap_pvt_thread_mutex_init( &syncrepl_rq.rq_mutex );
        LDAP_STAILQ_INIT( &syncrepl_rq.task_list );
        LDAP_STAILQ_INIT( &syncrepl_rq.run_list );
-#endif
 
        /* open each backend database */
        for( i = 0; i < nBackendDB; i++ ) {
                /* append global access controls */
                acl_append( &backendDB[i].be_acl, global_acl );
 
-#ifdef LDAP_SYNC
                LDAP_TAILQ_INIT( &backendDB[i].be_pending_csn_list );
-#endif
 
                if ( backendDB[i].bd_info->bi_db_open ) {
                        rc = backendDB[i].bd_info->bi_db_open(
@@ -369,7 +357,6 @@ int backend_startup(Backend *be)
                        }
                }
 
-#ifdef LDAP_SYNCREPL
                if ( backendDB[i].syncinfo != NULL ) {
                        syncinfo_t *si = ( syncinfo_t * ) backendDB[i].syncinfo;
                        si->be = &backendDB[i];
@@ -378,7 +365,6 @@ int backend_startup(Backend *be)
                                                        do_syncrepl, (void *) backendDB[i].syncinfo );
                        ldap_pvt_thread_mutex_unlock( &syncrepl_rq.rq_mutex );
                }
-#endif
        }
 
        return rc;
@@ -461,9 +447,7 @@ int backend_destroy(void)
        int i;
        BackendDB *bd;
 
-#ifdef LDAP_SYNCREPL
-        ldap_pvt_thread_pool_destroy( &syncrepl_pool, 1 );
-#endif
+       ldap_pvt_thread_pool_destroy( &syncrepl_pool, 1 );
 
        /* destroy each backend database */
        for( i = 0, bd = backendDB; i < nBackendDB; i++, bd++ ) {
@@ -544,16 +528,12 @@ backend_db_init(
        be->be_requires = global_requires;
        be->be_ssf_set = global_ssf_set;
 
-#ifdef LDAP_SYNC
        be->be_context_csn.bv_len = 0;
        be->be_context_csn.bv_val = NULL;
        ldap_pvt_thread_mutex_init( &be->be_pcl_mutex );
        ldap_pvt_thread_mutex_init( &be->be_context_csn_mutex );
-#endif
 
-#ifdef LDAP_SYNCREPL
        be->syncinfo = NULL;
-#endif
 
        /* assign a default depth limit for alias deref */
        be->be_max_deref_depth = SLAPD_DEFAULT_MAXDEREFDEPTH; 
index a5ef060282aaa4908855d963256e43ab40125e3e..0916bcac9802f5fec580c87db00e78fc7c6cccf9 100644 (file)
@@ -78,7 +78,6 @@ int cancel_extop( Operation *op, SlapReply *rs )
        }
 
        if ( !found ) {
-#ifdef LDAP_SYNC
                for ( i = 0; i < nbackends; i++ ) {
                        op->o_bd = &backends[i];
                        if( !op->o_bd->be_cancel ) continue;
@@ -91,7 +90,6 @@ int cancel_extop( Operation *op, SlapReply *rs )
                        }
                        ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
                }
-#endif
                ldap_pvt_thread_mutex_unlock( &op->o_conn->c_mutex );
                rs->sr_text = "message ID not found";
                return LDAP_NO_SUCH_OPERATION;
index c619eb51569b3cb1b351996a4d6f5721c5bf9770..5f072309dbeb6fe9b23cda6ef9c8d34b3fe4d2e8 100644 (file)
@@ -80,10 +80,8 @@ static int   fp_parse_line(int lineno, char *line);
 static char    *strtok_quote(char *line, char *sep);
 static int      load_ucdata(char *path);
 
-#ifdef LDAP_SYNCREPL
 static void     add_syncrepl LDAP_P(( Backend *, char **, int ));
 static int      parse_syncrepl_line LDAP_P(( char **, int, syncinfo_t *));
-#endif
 
 int
 read_config( const char *fname, int depth )
@@ -1747,12 +1745,10 @@ read_config( const char *fname, int depth )
                                ldap_syslog += atoi( cargv[1] );
                        }
 
-#ifdef LDAP_SYNCREPL
                /* list of sync replication information in this backend (slave only) */
                } else if ( strcasecmp( cargv[0], "syncrepl" ) == 0 ) {
 
                        add_syncrepl( be, cargv, cargc );
-#endif
 
                /* list of replicas of the data in this backend (master only) */
                } else if ( strcasecmp( cargv[0], "replica" ) == 0 ) {
@@ -2733,7 +2729,6 @@ config_destroy( )
        acl_destroy( global_acl, NULL );
 }
 
-#ifdef LDAP_SYNCREPL
 static void
 add_syncrepl(
        Backend *be,
@@ -3046,4 +3041,3 @@ parse_syncrepl_line(
 
        return 0;
 }
-#endif /* LDAP_SYNCREPL */
index 2f4d8978508a2b839ed86f768cec33d976bb3e46..fc693bdedbb9dac96ab844ade978bb5653b3330e 100644 (file)
@@ -1085,14 +1085,12 @@ operations_error:
        LDAP_STAILQ_REMOVE( &conn->c_ops, op, slap_op, o_next);
        LDAP_STAILQ_NEXT(op, o_next) = NULL;
 
-#ifdef LDAP_SYNC
        if ( op->o_cancel == SLAP_CANCEL_ACK )
                goto co_op_free;
        if ( ( op->o_sync_mode & SLAP_SYNC_PERSIST ) ) {
                sl_mem_detach( ctx, memctx );
                goto no_co_op_free;
        }
-#endif
 
 co_op_free:
 
index 8a022a0dd47e8c169a68c291ccfdfedac7ce5578..e24ce18023ca03c960496c9903e2a5d2d7ecabd9 100644 (file)
@@ -32,9 +32,7 @@ static SLAP_CTRL_PARSE_FN parseDomainScope;
 #ifdef LDAP_CONTROL_SUBENTRIES
 static SLAP_CTRL_PARSE_FN parseSubentries;
 #endif
-#ifdef LDAP_SYNC
 static SLAP_CTRL_PARSE_FN parseLdupSync;
-#endif
 
 #undef sc_mask /* avoid conflict with Irix 6.5 <sys/signal.h> */
 
@@ -98,11 +96,9 @@ static struct slap_control control_defs[] = {
        { LDAP_CONTROL_NOOP,
                SLAP_CTRL_ACCESS, NULL,
                parseNoOp, LDAP_SLIST_ENTRY_INITIALIZER(next) },
-#ifdef LDAP_SYNC
        { LDAP_CONTROL_SYNC,
                SLAP_CTRL_HIDE|SLAP_CTRL_SEARCH, NULL,
                parseLdupSync, LDAP_SLIST_ENTRY_INITIALIZER(next) },
-#endif
        { LDAP_CONTROL_MODIFY_INCREMENT,
                SLAP_CTRL_MODIFY, NULL,
                parseModifyIncrement, LDAP_SLIST_ENTRY_INITIALIZER(next) },
@@ -1093,7 +1089,6 @@ static int parseDomainScope (
 }
 #endif
 
-#ifdef LDAP_SYNC
 static int parseLdupSync (
        Operation *op,
        SlapReply *rs,
@@ -1179,4 +1174,3 @@ static int parseLdupSync (
 
        return LDAP_SUCCESS;
 }
-#endif
index 1f9f1c08bec4454e3e107db2f754c170bc245de4..381784396ff231cc5f6d2d6f5cfa2405b73f45c5 100644 (file)
@@ -33,8 +33,6 @@
 #include "slap.h"
 #include "lutil_ldap.h"
 
-#ifdef LDAP_SYNC
-
 struct berval *
 slap_get_commit_csn( Operation *op )
 {
@@ -315,4 +313,3 @@ slap_get_csn(
 
        return LDAP_SUCCESS;
 }
-#endif
index 6db9fa7222bf5aa04de7e507092d3d7dd198a1da..042fa24b01ca5d020088ca9478f5ca7c17259f60 100644 (file)
@@ -20,9 +20,7 @@
 #include "lutil.h"
 #include "slap.h"
 
-#ifdef LDAP_SYNCREPL
 #include "ldap_rq.h"
-#endif
 
 #ifdef HAVE_TCPD
 #include <tcpd.h>
@@ -1256,11 +1254,9 @@ slapd_daemon_task(
                struct timeval          tv;
                struct timeval          *tvp;
 
-#ifdef LDAP_SYNCREPL
                struct timeval          *cat;
                time_t                          tdelta = 1;
                struct re_s*            rtask;
-#endif
                now = slap_get_time();
 
                if( ( global_idletimeout > 0 ) &&
@@ -1349,7 +1345,6 @@ slapd_daemon_task(
                else
                        tvp = NULL;
 
-#ifdef LDAP_SYNCREPL
                ldap_pvt_thread_mutex_lock( &syncrepl_rq.rq_mutex );
                rtask = ldap_pvt_runqueue_next_sched( &syncrepl_rq, &cat );
                while ( cat && cat->tv_sec && cat->tv_sec <= now ) {
@@ -1377,7 +1372,6 @@ slapd_daemon_task(
                                tvp = &tv;
                        }
                }
-#endif
 
                for ( l = 0; slap_listeners[l] != NULL; l++ ) {
                        if ( slap_listeners[l]->sl_sd == AC_SOCKET_INVALID ||
index 6b4791e88344a13c4033226bdba8577226d108ff..7c46560c4e1b27a982918782fee53e1fac44de87 100644 (file)
@@ -25,9 +25,7 @@
 #include "ldap_pvt.h"
 #include "slap.h"
 
-#ifdef LDAP_SYNC
 #include "lutil.h"
-#endif
 
 #ifdef LDAP_SLAPI
 #include "slapi.h"
@@ -194,22 +192,18 @@ do_delete(
        if ( op->o_bd->be_delete ) {
                /* do the update here */
                int repl_user = be_isupdate( op->o_bd, &op->o_ndn );
-#if defined(LDAP_SYNCREPL) && !defined(SLAPD_MULTIMASTER)
+#ifndef SLAPD_MULTIMASTER
                if ( !op->o_bd->syncinfo && ( !op->o_bd->be_update_ndn.bv_len || repl_user ))
-#elif defined(LDAP_SYNCREPL) && defined(SLAPD_MULTIMASTER)
-               if ( !op->o_bd->syncinfo )  /* LDAP_SYNCREPL overrides MM */
-#elif !defined(LDAP_SYNCREPL) && !defined(SLAPD_MULTIMASTER)
-               if ( !op->o_bd->be_update_ndn.bv_len || repl_user )
+#else
+               if ( !op->o_bd->syncinfo )
 #endif
                {
 
-#ifdef LDAP_SYNC
                        if ( !repl_user ) {
                                struct berval csn = { 0 , NULL };
                                char csnbuf[ LDAP_LUTIL_CSNSTR_BUFSIZE ];
                                slap_get_csn( op, csnbuf, sizeof(csnbuf), &csn, 1 );
                        }
-#endif
 
                        if ( (op->o_bd->be_delete)( op, rs ) == 0 ) {
 #ifdef SLAPD_MULTIMASTER
@@ -219,15 +213,12 @@ do_delete(
                                        replog( op );
                                }
                        }
-#if defined(LDAP_SYNCREPL) || !defined(SLAPD_MULTIMASTER)
+#ifndef SLAPD_MULTIMASTER
                } else {
                        BerVarray defref = NULL;
-#ifdef LDAP_SYNCREPL
                        if ( op->o_bd->syncinfo ) {
                                defref = op->o_bd->syncinfo->provideruri_bv;
-                       } else
-#endif
-                       {
+                       } else {
                                defref = op->o_bd->be_update_refs
                                                ? op->o_bd->be_update_refs : default_referral;
                        }
@@ -266,9 +257,7 @@ do_delete(
 
 cleanup:
 
-#ifdef LDAP_SYNC
        slap_graduate_commit_csn( op );
-#endif
 
        op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
        op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
index decaa9f6845759cd615ada1ed34fe7f12ff5eb2e..95af77aa0df84bf78d3a80c0591b863089ef8f23 100644 (file)
@@ -445,13 +445,11 @@ do_modify(
                /* Multimaster slapd does not have to check for replicator dn
                 * because it accepts each modify request
                 */
-#if defined(LDAP_SYNCREPL) && !defined(SLAPD_MULTIMASTER)
+#ifndef SLAPD_MULTIMASTER
                if ( !op->o_bd->syncinfo &&
                        ( !op->o_bd->be_update_ndn.bv_len || repl_user ))
-#elif defined(LDAP_SYNCREPL) && defined(SLAPD_MULTIMASTER)
-               if ( !op->o_bd->syncinfo )  /* LDAP_SYNCREPL overrides MM */
-#elif !defined(LDAP_SYNCREPL) && !defined(SLAPD_MULTIMASTER)
-               if ( !op->o_bd->be_update_ndn.bv_len || repl_user )
+#else
+               if ( !op->o_bd->syncinfo )
 #endif
                {
                        int update = op->o_bd->be_update_ndn.bv_len;
@@ -492,16 +490,13 @@ do_modify(
                                replog( op );
                        }
 
-#if defined(LDAP_SYNCREPL) || !defined(SLAPD_MULTIMASTER)
+#ifndef SLAPD_MULTIMASTER
                /* send a referral */
                } else {
                        BerVarray defref = NULL;
-#ifdef LDAP_SYNCREPL
                        if ( op->o_bd->syncinfo ) {
                                defref = op->o_bd->syncinfo->provideruri_bv;
-                       } else
-#endif
-                       {
+                       } else {
                                defref = op->o_bd->be_update_refs
                                                ? op->o_bd->be_update_refs : default_referral;
                        }
@@ -543,9 +538,7 @@ do_modify(
 
 cleanup:
 
-#ifdef LDAP_SYNC
        slap_graduate_commit_csn( op );
-#endif
 
        op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
        op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
@@ -773,19 +766,12 @@ int slap_mods_opattrs(
        int mop = op->o_tag == LDAP_REQ_ADD
                ? LDAP_MOD_ADD : LDAP_MOD_REPLACE;
 
-#ifdef LDAP_SYNCREPL
        syncinfo_t *si = op->o_si;
-#endif
 
        assert( modtail != NULL );
        assert( *modtail == NULL );
 
-#ifdef LDAP_SYNCREPL
-       if ( SLAP_LASTMOD(op->o_bd) && ( !si || si->lastmod == LASTMOD_GEN ))
-#else
-       if ( SLAP_LASTMOD(op->o_bd) )
-#endif
-       {
+       if ( SLAP_LASTMOD(op->o_bd) && ( !si || si->lastmod == LASTMOD_GEN )) {
                struct tm *ltm;
                time_t now = slap_get_time();
 
@@ -793,11 +779,7 @@ int slap_mods_opattrs(
                ltm = gmtime( &now );
                lutil_gentime( timebuf, sizeof(timebuf), ltm );
 
-#ifdef LDAP_SYNC
                slap_get_csn( op, csnbuf, sizeof(csnbuf), &csn, 1 );
-#else
-               slap_get_csn( op, csnbuf, sizeof(csnbuf), &csn, 0 );
-#endif
 
                ldap_pvt_thread_mutex_unlock( &gmtime_mutex );
 
@@ -842,17 +824,10 @@ int slap_mods_opattrs(
                        modtail = &mod->sml_next;
                }
 
-#ifdef LDAP_SYNCREPL
-               if ( SLAP_LASTMOD(op->o_bd) && ( !si || si->lastmod == LASTMOD_GEN ))
-#else
-               if ( SLAP_LASTMOD(op->o_bd) )
-#endif
-               {
+               if ( SLAP_LASTMOD(op->o_bd) && ( !si || si->lastmod == LASTMOD_GEN )) {
                        char uuidbuf[ LDAP_LUTIL_UUIDSTR_BUFSIZE ];
 
-#ifdef LDAP_SYNCREPL
                        if ( !si ) {
-#endif
                                tmpval.bv_len = lutil_uuidstr( uuidbuf, sizeof( uuidbuf ) );
                                tmpval.bv_val = uuidbuf;
                
@@ -869,9 +844,7 @@ int slap_mods_opattrs(
                                mod->sml_nvalues = NULL;
                                *modtail = mod;
                                modtail = &mod->sml_next;
-#ifdef LDAP_SYNCREPL
                        }
-#endif
 
                        mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
                        mod->sml_op = mop;
@@ -906,12 +879,7 @@ int slap_mods_opattrs(
                }
        }
 
-#ifdef LDAP_SYNCREPL
-       if ( SLAP_LASTMOD(op->o_bd) && ( !si || si->lastmod == LASTMOD_GEN ))
-#else
-       if ( SLAP_LASTMOD(op->o_bd) )
-#endif
-       {
+       if ( SLAP_LASTMOD(op->o_bd) && ( !si || si->lastmod == LASTMOD_GEN )) {
                mod = (Modifications *) ch_malloc( sizeof( Modifications ) );
                mod->sml_op = mop;
                mod->sml_type.bv_val = NULL;
index 4f8551a53edde63b1ff546bf39b5d88510cd1c64..f780dd3aa26ee2f1479ef4b518f27ad2e5d7d150 100644 (file)
@@ -353,13 +353,11 @@ do_modrdn(
        if ( op->o_bd->be_modrdn ) {
                /* do the update here */
                int repl_user = be_isupdate( op->o_bd, &op->o_ndn );
-#if defined(LDAP_SYNCREPL) && !defined(SLAPD_MULTIMASTER)
+#ifndef SLAPD_MULTIMASTER
                if ( !op->o_bd->syncinfo &&
                                        ( !op->o_bd->be_update_ndn.bv_len || repl_user ))
-#elif defined(LDAP_SYNCREPL) && defined(SLAPD_MULTIMASTER)
-               if ( !op->o_bd->syncinfo )  /* LDAP_SYNCREPL overrides MM */
-#elif !defined(LDAP_SYNCREPL) && !defined(SLAPD_MULTIMASTER)
-               if ( !op->o_bd->be_update_ndn.bv_len || repl_user )
+#else
+               if ( !op->o_bd->syncinfo )
 #endif
                {
                        op->orr_deleteoldrdn = deloldrdn;
@@ -370,15 +368,12 @@ do_modrdn(
                        ) {
                                replog( op );
                        }
-#if defined(LDAP_SYNCREPL) || !defined(SLAPD_MULTIMASTER)
+#ifndef SLAPD_MULTIMASTER
                } else {
                        BerVarray defref = NULL;
-#ifdef LDAP_SYNCREPL
                        if ( op->o_bd->syncinfo ) {
                                defref = op->o_bd->syncinfo->provideruri_bv;
-                       } else
-#endif
-                       {
+                       } else {
                                defref = op->o_bd->be_update_refs
                                                ? op->o_bd->be_update_refs : default_referral;
                        }
@@ -417,9 +412,7 @@ do_modrdn(
 
 cleanup:
 
-#ifdef LDAP_SYNC
        slap_graduate_commit_csn( op );
-#endif
 
        op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
        op->o_tmpfree( op->o_req_ndn.bv_val, op->o_tmpmemctx );
index 34050fd5fb31b8d9f1d8481a386c1893e6849fdf..4efd292a80cfd41506900a9158882d4a653890e8 100644 (file)
@@ -65,11 +65,9 @@ slap_op_free( Operation *op )
                ber_free( op->o_res_ber, 1 );
        }
 #endif
-#ifdef LDAP_SYNC
        if ( op->o_sync_state.bv_val != NULL ) {
                free( op->o_sync_state.bv_val );
        }
-#endif
 
 #if defined( LDAP_SLAPI )
        if ( op->o_pb != NULL ) {
index edb34415e46fe3d2c820857906ffd7a9f724fcb1..d1f7cdcd32ebb78a09c738242437615f5c46acd8 100644 (file)
@@ -52,16 +52,14 @@ int passwd_extop(
                rs->sr_err = LDAP_OTHER;
 #endif
 
-#if defined(LDAP_SYNCREPL) || !defined(SLAPD_MULTIMASTER)
+#ifndef SLAPD_MULTIMASTER
        /* This does not apply to multi-master case */
        } else if( op->o_bd->be_update_ndn.bv_len ) {
                /* we SHOULD return a referral in this case */
                BerVarray defref = NULL;
-#ifdef LDAP_SYNCREPL
                if ( op->o_bd->syncinfo ) {
                        defref = op->o_bd->syncinfo->provideruri_bv;
                } else
-#endif
                {
                        defref = referral_rewrite( op->o_bd->be_update_refs,
                                NULL, NULL, LDAP_SCOPE_DEFAULT );
index 162dc8ddc8961601a3083ad72c24658dc53cb875..1acac49d95d57a8e4d080b6927cc22b8b29f45ec 100644 (file)
@@ -358,13 +358,11 @@ LDAP_SLAPD_F (ContentRule *) cr_bvfind LDAP_P((
  * ctxcsn.c
  */
 
-#ifdef LDAP_SYNC
 LDAP_SLAPD_F (struct berval *) slap_get_commit_csn LDAP_P(( Operation * ));
 LDAP_SLAPD_F (void) slap_rewind_commit_csn LDAP_P(( Operation * ));
 LDAP_SLAPD_F (void) slap_graduate_commit_csn LDAP_P(( Operation * ));
 LDAP_SLAPD_F (Entry *) slap_create_context_csn_entry LDAP_P(( Backend *, struct berval *));
 LDAP_SLAPD_F (int) slap_get_csn LDAP_P(( Operation *, const char *, int, struct berval *, int ));
-#endif
 
 /*
  * daemon.c
@@ -734,12 +732,10 @@ LDAP_SLAPD_F (int) is_entry_objectclass LDAP_P((
        (((e)->e_ocflags & SLAP_OC__END) \
         ? (((e)->e_ocflags & SLAP_OC_DYNAMICOBJECT) != 0) \
         : is_entry_objectclass((e), slap_schema.si_oc_dynamicObject, 1))
-#ifdef LDAP_SYNCREPL
 #define is_entry_glue(e)       \
        (((e)->e_ocflags & SLAP_OC__END) \
         ? (((e)->e_ocflags & SLAP_OC_GLUE) != 0) \
         : is_entry_objectclass((e), slap_schema.si_oc_glue, 1))
-#endif
 
 LDAP_SLAPD_F (int) oc_schema_info( Entry *e );
 
@@ -1159,7 +1155,6 @@ LDAP_SLAPD_F (int) do_extended LDAP_P((Operation *op, SlapReply *rs));
  * syncrepl
  */
 
-#ifdef LDAP_SYNCREPL
 LDAP_SLAPD_V (struct runqueue_s) syncrepl_rq;
 
 LDAP_SLAPD_F (void) init_syncrepl LDAP_P(());
@@ -1179,7 +1174,6 @@ LDAP_SLAPD_F (char **) str2clist LDAP_P(( char ***, char *, const char * ));
 
 LDAP_SLAPD_F (void)  syncrepl_add_glue LDAP_P(( syncinfo_t *, LDAP *, Operation*, Entry*,
                                                        Modifications*, int, struct berval*, struct berval* ));
-#endif
 
 LDAP_END_DECL
 
index 446202e86c640dc183249ddfe1d308651943c0a8..2aeafa3abd17bb2f00edba7052b9ce537a52d226 100644 (file)
@@ -214,25 +214,17 @@ entry_schema_check(
                        aoc->a_vals[0].bv_val );
                return LDAP_OBJECT_CLASS_VIOLATION;
 
-#ifdef LDAP_SYNCREPL
        } else if ( sc != slap_schema.si_oc_glue && sc != oc ) {
-#else
-       } else if ( sc != oc ) {
-#endif
                snprintf( textbuf, textlen, 
                        "structural object class modification "
                        "from '%s' to '%s' not allowed",
                        asc->a_vals[0].bv_val, nsc.bv_val );
                return LDAP_NO_OBJECT_CLASS_MODS;
-       }
-#ifdef LDAP_SYNCREPL
-       else if ( sc == slap_schema.si_oc_glue ) {
+       } else if ( sc == slap_schema.si_oc_glue ) {
                sc = oc;
        }
-#endif
 
        /* naming check */
-#ifdef LDAP_SYNCREPL
         if ( !is_entry_objectclass ( e, slap_schema.si_oc_glue, 0 ) ) {
                 rc = entry_naming_check( e, text, textbuf, textlen );
                 if( rc != LDAP_SUCCESS ) {
@@ -241,12 +233,6 @@ entry_schema_check(
         } else {
                        /* Glue Entry */
         }
-#else
-        rc = entry_naming_check( e, text, textbuf, textlen );
-        if( rc != LDAP_SUCCESS ) {
-                return rc;
-        }
-#endif
 
 #ifdef SLAP_EXTENDED_SCHEMA
        /* find the content rule for the structural class */
index a9ddbd09e8e911112860285ab59c559de6913d6f..e29fb64f41dba3a9d76e8106239b2f7b76bcc125 100644 (file)
@@ -224,7 +224,6 @@ static struct slap_schema_oc_map {
                dynamicObjectClass, SLAP_OC_DYNAMICOBJECT,
                offsetof(struct slap_internal_schema, si_oc_dynamicObject) },
 #endif
-#ifdef LDAP_SYNCREPL
        { "glue", "( 1.3.6.1.4.1.4203.666.3.4 "
                        "NAME 'glue' "
                        "DESC 'Glue Entry' "
@@ -238,8 +237,6 @@ static struct slap_schema_oc_map {
                        "MAY syncreplCookie )",
                0, SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
                offsetof(struct slap_internal_schema, si_oc_syncConsumerSubentry) },
-#endif
-#ifdef LDAP_SYNC
        { "syncProviderSubentry", "( 1.3.6.1.4.1.4203.666.3.6 "
                        "NAME 'syncProviderSubentry' "
                        "DESC 'Persistent Info for SyncRepl Producer' "
@@ -247,7 +244,6 @@ static struct slap_schema_oc_map {
                        "MAY contextCSN )",
                0, SLAP_OC_OPERATIONAL|SLAP_OC_HIDE,
                offsetof(struct slap_internal_schema, si_oc_syncProviderSubentry) },
-#endif
 
        { NULL, NULL, NULL, 0, 0 }
 };
@@ -423,7 +419,6 @@ static struct slap_schema_ad_map {
                offsetof(struct slap_internal_schema, si_ad_queryid) },
 #endif /* LDAP_CACHING */
 
-#ifdef LDAP_SYNCREPL
        { "syncreplCookie", "( 1.3.6.1.4.1.4203.666.1.23 "
                        "NAME 'syncreplCookie' "
                        "DESC 'syncrepl Cookie for shadow copy' "
@@ -435,8 +430,7 @@ static struct slap_schema_ad_map {
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_syncreplCookie) },
-#endif
-#ifdef LDAP_SYNC
+
        { "contextCSN", "( 1.3.6.1.4.1.4203.666.1.25 "
                        "NAME 'contextCSN' "
                        "DESC 'the largest committed CSN of a context' "
@@ -448,7 +442,6 @@ static struct slap_schema_ad_map {
                NULL, NULL,
                NULL, NULL, NULL, NULL, NULL,
                offsetof(struct slap_internal_schema, si_ad_contextCSN) },
-#endif
 
        /* root DSE attributes */
        { "altServer", "( 1.3.6.1.4.1.1466.101.120.6 NAME 'altServer' "
index ea93719e23cbb689e2296c1d96567ea4acb8a23e..71c8960611aece6f804d8c6345d578054410cf80 100644 (file)
@@ -337,12 +337,9 @@ do_search(
        /* Sync control overrides manageDSAit */
 
        if ( manageDSAit != SLAP_NO_CONTROL ) {
-#ifdef LDAP_SYNC
                if ( op->o_sync_mode & SLAP_SYNC_REFRESH ) {
                        be_manageDSAit = SLAP_NO_CONTROL;
-               } else
-#endif
-               {
+               } else {
                        be_manageDSAit = manageDSAit;
                }
        } else {
@@ -399,10 +396,8 @@ do_search(
 
 return_results:;
 
-#ifdef LDAP_SYNC
        if ( ( op->o_sync_mode & SLAP_SYNC_PERSIST ) )
                return rs->sr_err;
-#endif
 
        if( op->o_req_dn.bv_val != NULL) sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
        if( op->o_req_ndn.bv_val != NULL) sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
index bf683420382fd2eba0cf0c4780cbbcf43f0f3883..948145c3d74b5c4f3966b4b0e81ca1067c632daa 100644 (file)
@@ -76,9 +76,7 @@ LDAP_BEGIN_DECL
 
 #define SLAP_MAX_WORKER_THREADS                (16)
 
-#ifdef LDAP_SYNCREPL
 #define SLAP_MAX_SYNCREPL_THREADS      (8)
-#endif
 
 #define SLAP_SB_MAX_INCOMING_DEFAULT ((1<<18) - 1)
 #define SLAP_SB_MAX_INCOMING_AUTH ((1<<24) - 1)
@@ -644,14 +642,9 @@ typedef struct slap_object_class {
 #define        SLAP_OC_SUBENTRY        0x0004
 #define        SLAP_OC_DYNAMICOBJECT   0x0008
 #define        SLAP_OC_COLLECTIVEATTRIBUTESUBENTRY     0x0010
-#ifdef LDAP_SYNCREPL
 #define SLAP_OC_GLUE           0x0020
 #define        SLAP_OC__MASK           0x003F
 #define        SLAP_OC__END            0x0040
-#else
-#define        SLAP_OC__MASK           0x001F
-#define        SLAP_OC__END            0x0020
-#endif
 #define SLAP_OC_OPERATIONAL    0x4000
 #ifdef LDAP_DEVEL
 #define SLAP_OC_HIDE           0x0000
@@ -720,11 +713,9 @@ struct slap_internal_schema {
        ObjectClass *si_oc_collectiveAttributeSubentry;
        ObjectClass *si_oc_dynamicObject;
 
-#ifdef LDAP_SYNCREPL
        ObjectClass *si_oc_glue;
        ObjectClass *si_oc_syncConsumerSubentry;
        ObjectClass *si_oc_syncProviderSubentry;
-#endif
 
        /* objectClass attribute descriptions */
        AttributeDescription *si_ad_objectClass;
@@ -749,11 +740,9 @@ struct slap_internal_schema {
        AttributeDescription *si_ad_queryid;
 #endif /* LDAP_CACHING */
 
-#ifdef LDAP_SYNCREPL
        AttributeDescription *si_ad_dseType;
        AttributeDescription *si_ad_syncreplCookie;
        AttributeDescription *si_ad_contextCSN;
-#endif
 
        /* root DSE attribute descriptions */
        AttributeDescription *si_ad_altServer;
@@ -1286,7 +1275,6 @@ typedef BackendDB Backend;
 #define nbackends nBackendDB
 #define backends backendDB
 
-#ifdef LDAP_SYNCREPL
 struct nonpresent_entry {
        struct berval *dn;
        struct berval *ndn;
@@ -1342,8 +1330,6 @@ typedef struct syncinfo_s {
                LDAP_LIST_HEAD(np, nonpresent_entry) nonpresentlist;
 } syncinfo_t;
 
-#endif /* LDAP_SYNCREPL */
-
 struct slap_backend_db {
        BackendInfo     *bd_info;       /* pointer to shared backend info */
 
@@ -1491,15 +1477,11 @@ struct slap_backend_db {
        void    *be_private;    /* anything the backend database needs     */
 
        void    *be_pb;         /* Netscape plugin */
-#ifdef LDAP_SYNC
        LDAP_TAILQ_HEAD( pcl, slap_csn_entry )  be_pending_csn_list;
        ldap_pvt_thread_mutex_t                                 be_pcl_mutex;
        struct berval                                                   be_context_csn;
        ldap_pvt_thread_mutex_t                                 be_context_csn_mutex;
-#endif
-#ifdef LDAP_SYNCREPL
        syncinfo_t      *syncinfo;      /* For syncrepl */
-#endif
 };
 
 struct slap_conn;
@@ -1807,7 +1789,6 @@ typedef struct slap_paged_state {
 } PagedResultsState;
 
 
-#ifdef LDAP_SYNC
 #define LDAP_PSEARCH_BY_ADD                    0x01
 #define LDAP_PSEARCH_BY_DELETE         0x02
 #define LDAP_PSEARCH_BY_PREMODIFY      0x03
@@ -1828,8 +1809,6 @@ struct slap_csn_entry {
        long state;
        LDAP_TAILQ_ENTRY (slap_csn_entry) csn_link;
 };
-#endif
-
 
 /*
  * represents an operation pending from an ldap client
@@ -1954,7 +1933,6 @@ typedef struct slap_op {
 #define get_pagedresults(op)                   (0)
 #endif
 
-#ifdef LDAP_SYNC
        char o_sync;
        char o_sync_mode;
 #define SLAP_SYNC_NONE                         (0x0)
@@ -1966,7 +1944,6 @@ typedef struct slap_op {
        int o_ps_entries;
        LDAP_LIST_ENTRY(slap_op) o_ps_link;
        LDAP_LIST_HEAD(pe, psid_entry) o_pm_list;
-#endif
 
        AuthorizationInformation o_authz;
 
@@ -1992,9 +1969,7 @@ typedef struct slap_op {
 #define get_assertion(op)                              ((op)->o_assertion)
        ValuesReturnFilter *o_vrFilter; /* ValuesReturnFilter */
 
-#ifdef LDAP_SYNCREPL
        syncinfo_t*     o_si;
-#endif
 
 #ifdef LDAP_SLAPI
        void    *o_pb;                  /* NS-SLAPI plugin */
@@ -2200,9 +2175,7 @@ enum {
 #define SLAP_LDAPDN_PRETTY 0x1
 #define SLAP_LDAPDN_MAXLEN 8192
 
-#ifdef LDAP_SYNC
 #define SLAP_SEARCH_MAX_CTRLS   10
-#endif
 
 #ifdef LDAP_DEVEL
 #define SLAP_CTRL_HIDE                         0x00000000U
index 9b6975e7be322f31da616612edf118ce25eef800..79cd3de82be07267e87104d771f29d8ca22b0b66 100644 (file)
@@ -33,8 +33,6 @@
 #include "slap.h"
 #include "lutil_ldap.h"
 
-#ifdef LDAP_SYNCREPL
-
 #include "ldap_rq.h"
 
 static void
@@ -1696,4 +1694,3 @@ str2clist( char ***out, char *in, const char *brkstr )
        free( str );
        return( *out );
 }
-#endif
index 3c2431f33933519c9e301de1a10f0f550db37988..483550ab6eeb0a4d8874ddabe1c9273a2aa450cd 100644 (file)
@@ -13,9 +13,7 @@
 
 #include "../slap.h"
 
-#ifdef LDAP_SYNCREPL
 #include "ldap_rq.h"
-#endif
 
 /* needed by WIN32 and back-monitor */
 time_t starttime;
@@ -262,7 +260,6 @@ int root_dse_info( Connection *conn, Entry **entry, const char **text )
        return -1;
 }
 
-#ifdef LDAP_SYNCREPL
 struct runqueue_s syncrepl_rq;
 
 void init_syncrepl( )
@@ -308,4 +305,3 @@ Entry *slap_create_context_csn_entry( Backend *be, struct berval *context_csn )
        return NULL;
 }
 #endif
-#endif