]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Remove LDAP_X_TXN and rename accordingly
authorOndřej Kuzník <ondra@mistotebe.net>
Tue, 28 Jan 2020 11:50:33 +0000 (11:50 +0000)
committerOndřej Kuzník <ondra@mistotebe.net>
Tue, 28 Jan 2020 12:09:09 +0000 (12:09 +0000)
23 files changed:
clients/tools/ldapmodify.c
include/ldap.h
libraries/libldap/error.c
libraries/libldap/txn.c
servers/slapd/add.c
servers/slapd/back-mdb/add.c
servers/slapd/back-mdb/delete.c
servers/slapd/back-mdb/id2entry.c
servers/slapd/back-mdb/init.c
servers/slapd/back-mdb/modify.c
servers/slapd/back-mdb/modrdn.c
servers/slapd/back-ndb/init.cpp
servers/slapd/back-wt/delete.c
servers/slapd/back-wt/modify.c
servers/slapd/connection.c
servers/slapd/controls.c
servers/slapd/delete.c
servers/slapd/extended.c
servers/slapd/modify.c
servers/slapd/modrdn.c
servers/slapd/proto-slap.h
servers/slapd/slap.h
servers/slapd/txn.c

index 38a0c2e454a61e95edf499bfbcafdc4930425f1c..5f1e28d6be8d8edd162764ae9ce496b4e28247a6 100644 (file)
@@ -94,11 +94,9 @@ static int process_response(
        int res,
        const struct berval *dn );
 
-#ifdef LDAP_X_TXN
 static int txn = 0;
 static int txnabort = 0;
 struct berval *txn_id = NULL;
-#endif
 
 void
 usage( void )
@@ -117,10 +115,8 @@ usage( void )
        fprintf( stderr, _("  -f file    read operations from `file'\n"));
        fprintf( stderr, _("  -M         enable Manage DSA IT control (-MM to make critical)\n"));
        fprintf( stderr, _("  -P version protocol version (default: 3)\n"));
-#ifdef LDAP_X_TXN
        fprintf( stderr,
                _("             [!]txn=<commit|abort>         (transaction)\n"));
-#endif
        fprintf( stderr, _("  -S file    write skipped modifications to `file'\n"));
 
        tool_common_usage();
@@ -161,7 +157,6 @@ handle_private_option( int i )
                        *cvalue++ = '\0';
                }
 
-#ifdef LDAP_X_TXN
                if( strcasecmp( control, "txn" ) == 0 ) {
                        /* Transaction */
                        if( txn ) {
@@ -181,7 +176,6 @@ handle_private_option( int i )
 
                        txn = 1 + crit;
                } else
-#endif
                {
                        fprintf( stderr, _("Invalid modify extension name: %s\n"),
                                control );
@@ -265,7 +259,6 @@ main( int argc, char **argv )
                tool_bind( ld );
        }
 
-#ifdef LDAP_X_TXN
        if( txn ) {
                /* start transaction */
                rc = ldap_txn_start_s( ld, NULL, NULL, &txn_id );
@@ -278,22 +271,12 @@ main( int argc, char **argv )
                        txn = 0;
                }
        }
-#endif
 
-       if ( 0
-#ifdef LDAP_X_TXN
-               || txn
-#endif
-               )
-       {
-#ifdef LDAP_X_TXN
-               if( txn ) {
-                       c[i].ldctl_oid = LDAP_CONTROL_X_TXN_SPEC;
-                       c[i].ldctl_value = *txn_id;
-                       c[i].ldctl_iscritical = 1;
-                       i++;
-               }
-#endif
+       if( txn ) {
+               c[i].ldctl_oid = LDAP_CONTROL_TXN_SPEC;
+               c[i].ldctl_value = *txn_id;
+               c[i].ldctl_iscritical = 1;
+               i++;
        }
 
        tool_server_controls( ld, c, i );
@@ -348,7 +331,6 @@ main( int argc, char **argv )
        if ( ldifrc < 0 )
                retval = LDAP_OTHER;
 
-#ifdef LDAP_X_TXN
        if( retval == 0 && txn ) {
                rc = ldap_set_option( ld, LDAP_OPT_SERVER_CONTROLS, NULL );
                if ( rc != LDAP_OPT_SUCCESS ) {
@@ -362,7 +344,6 @@ main( int argc, char **argv )
                        retval = rc;
                }
        }
-#endif
 
 fail:;
        if ( rejfp != NULL ) {
@@ -694,12 +675,9 @@ static int process_response(
        rc = ldap_parse_result( ld, res, &err, &matched, &text, &refs, &ctrls, 1 );
        if ( rc == LDAP_SUCCESS ) rc = err;
 
-#ifdef LDAP_X_TXN
-       if ( rc == LDAP_X_TXN_SPECIFY_OKAY ) {
+       if ( rc == LDAP_TXN_SPECIFY_OKAY ) {
                rc = LDAP_SUCCESS;
-       } else
-#endif
-       if ( rc != LDAP_SUCCESS ) {
+       } else if ( rc != LDAP_SUCCESS ) {
                tool_perror( res2str( op ), rc, NULL, matched, text, refs );
        } else if ( msgtype != op ) {
                fprintf( stderr, "%s: msgtype: expected %d got %d\n",
index 74385dd0e16c8880c69265f744b650da8bc0a041..452e2917bcf0c4fe4f131f9e78bbfaa3002c60a0 100644 (file)
@@ -438,16 +438,10 @@ typedef struct ldapcontrol {
 #define LDAP_URLEXT_X_FAILEDNAME       "x-failedName"
 
 #define LDAP_TXN                                               "1.3.6.1.1.21" /* RFC 5805 */
-#define LDAP_EXOP_TXN_START                            LDAP_X_TXN ".1"
-#define LDAP_CONTROL_TXN_SPEC                  LDAP_X_TXN ".2"
-#define LDAP_EXOP_TXN_END                              LDAP_X_TXN ".3"
-#define LDAP_EXOP_TXN_ABORTED_NOTICE   LDAP_X_TXN ".4"
-
-#define        LDAP_X_TXN      LDAP_TXN
-#define LDAP_EXOP_X_TXN_START                  LDAP_EXOP_TXN_START
-#define LDAP_CONTROL_X_TXN_SPEC                        LDAP_CONTROL_TXN_SPEC
-#define LDAP_EXOP_X_TXN_END                            LDAP_EXOP_TXN_END
-#define LDAP_EXOP_X_TXN_ABORTED_NOTICE LDAP_EXOP_TXN_ABORTED_NOTICE
+#define LDAP_EXOP_TXN_START                            LDAP_TXN ".1"
+#define LDAP_CONTROL_TXN_SPEC                  LDAP_TXN ".2"
+#define LDAP_EXOP_TXN_END                              LDAP_TXN ".3"
+#define LDAP_EXOP_TXN_ABORTED_NOTICE   LDAP_TXN ".4"
 
 /* LDAP Features */
 #define LDAP_FEATURE_ALL_OP_ATTRS      "1.3.6.1.4.1.4203.1.5.1"        /* RFC 3673 */
@@ -712,10 +706,8 @@ typedef struct ldapcontrol {
 #define LDAP_X_INVALIDREFERENCE                        0x4112
 #endif
 
-#ifdef LDAP_X_TXN
-#define LDAP_X_TXN_SPECIFY_OKAY                0x4120
-#define LDAP_X_TXN_ID_INVALID          0x4121
-#endif
+#define LDAP_TXN_SPECIFY_OKAY          0x4120
+#define LDAP_TXN_ID_INVALID                    0x4121
 
 /* API Error Codes
  *
@@ -2452,7 +2444,6 @@ ldap_refresh_s LDAP_P((
 /*
  * LDAP Transactions
  */
-#ifdef LDAP_X_TXN
 LDAP_F( int )
 ldap_txn_start LDAP_P(( LDAP *ld,
        LDAPControl             **sctrls,
@@ -2480,7 +2471,6 @@ ldap_txn_end_s LDAP_P(( LDAP *ld,
        LDAPControl **sctrl,
        LDAPControl **cctrl,
        int *retidp ));
-#endif
 
 /*
  * in ldap_sync.c
index c5c712e4aad491f772a46a5d4b794f0b3581afed..40b03447d9e06836a72c654d799e26d1f952f67d 100644 (file)
@@ -126,11 +126,8 @@ ldap_err2string( int err )
        C(LDAP_CUP_UNSUPPORTED_SCHEME,  N_("LCUP Unsupported Scheme"));
        C(LDAP_CUP_RELOAD_REQUIRED,             N_("LCUP Reload Required"));
 
-#ifdef LDAP_X_TXN
-       /* Codes related to LDAP Transactions (draft-zeilenga-ldap-txn) */
-       C(LDAP_X_TXN_SPECIFY_OKAY,              N_("TXN specify okay"));
-       C(LDAP_X_TXN_ID_INVALID,                N_("TXN ID is invalid"));
-#endif
+       C(LDAP_TXN_SPECIFY_OKAY,                N_("TXN specify okay"));
+       C(LDAP_TXN_ID_INVALID,                  N_("TXN ID is invalid"));
 
        /* API codes - renumbered since draft-ietf-ldapext-ldap-c-api */
        C(LDAP_SERVER_DOWN,                             N_("Can't contact LDAP server"));
index b6679995d012de425ad6178b8ac51f22fec5d9db..491b1e6b28c542e557d2c9eb5d85bc93ae4e5995 100644 (file)
@@ -33,7 +33,6 @@
 #include "ldap-int.h"
 #include "ldap_log.h"
 
-#ifdef LDAP_X_TXN
 int
 ldap_txn_start(
        LDAP *ld,
@@ -41,7 +40,7 @@ ldap_txn_start(
        LDAPControl **cctrls,
        int *msgidp )
 {
-       return ldap_extended_operation( ld, LDAP_EXOP_X_TXN_START,
+       return ldap_extended_operation( ld, LDAP_EXOP_TXN_START,
                NULL, sctrls, cctrls, msgidp );
 }
 
@@ -54,7 +53,7 @@ ldap_txn_start_s(
 {
        assert( txnid != NULL );
 
-       return ldap_extended_operation_s( ld, LDAP_EXOP_X_TXN_START,
+       return ldap_extended_operation_s( ld, LDAP_EXOP_TXN_START,
                NULL, sctrls, cctrls, NULL, txnid );
 }
 
@@ -83,7 +82,7 @@ ldap_txn_end(
 
        ber_flatten( txnber, &txnval );
 
-       rc = ldap_extended_operation( ld, LDAP_EXOP_X_TXN_END,
+       rc = ldap_extended_operation( ld, LDAP_EXOP_TXN_END,
                txnval, sctrls, cctrls, msgidp );
 
        ber_free( txnber, 1 );
@@ -116,7 +115,7 @@ ldap_txn_end_s(
 
        ber_flatten( txnber, &txnval );
 
-       rc = ldap_extended_operation_s( ld, LDAP_EXOP_X_TXN_END,
+       rc = ldap_extended_operation_s( ld, LDAP_EXOP_TXN_END,
                txnval, sctrls, cctrls, NULL, &retdata );
 
        ber_free( txnber, 1 );
@@ -152,4 +151,3 @@ done:
 
        return rc;
 }
-#endif
index dfed98b94ffffd743f576e1461d807f5488febcf..4ceec9de971aa609334cc6978b0fdf3a7a100026 100644 (file)
@@ -199,13 +199,10 @@ do_add( Operation *op, SlapReply *rs )
        }
 
        LDAP_SLIST_REMOVE(&op->o_extra, &oex->oe, OpExtra, oe_next);
-#ifdef LDAP_X_TXN
-       if ( rc == LDAP_X_TXN_SPECIFY_OKAY ) {
+       if ( rc == LDAP_TXN_SPECIFY_OKAY ) {
                /* skip cleanup */
                return rc;
-       } else
-#endif
-       if ( rc == 0 ) {
+       } else if ( rc == 0 ) {
                if ( op->ora_e != NULL && oex->oe_db != NULL ) {
                        BackendDB       *bd = op->o_bd;
 
index b0c4c51e940623c395f2c31108c54df387cee503..b077bd13a46d1dbc9fa9e3fa4fe4bb9600984ca3 100644 (file)
@@ -48,10 +48,8 @@ mdb_add(Operation *op, SlapReply *rs )
        Debug(LDAP_DEBUG_ARGS, "==> " LDAP_XSTRING(mdb_add) ": %s\n",
                op->ora_e->e_name.bv_val );
 
-#ifdef LDAP_X_TXN
        if( op->o_txnSpec && txn_preop( op, rs ))
                return rs->sr_err;
-#endif
 
        ctrls[num_ctrls] = 0;
 
index bdece796f5e7ffc14d066b44c359167eb48f0efa..0f0cfbf96d4bf4b9d6692736c85cddbdf4da4a2f 100644 (file)
@@ -46,10 +46,8 @@ mdb_delete( Operation *op, SlapReply *rs )
        Debug( LDAP_DEBUG_ARGS, "==> " LDAP_XSTRING(mdb_delete) ": %s\n",
                op->o_req_dn.bv_val );
 
-#ifdef LDAP_X_TXN
        if( op->o_txnSpec && txn_preop( op, rs ))
                return rs->sr_err;
-#endif
 
        ctrls[num_ctrls] = 0;
 
index 9ce0b04fae3766167fd055fec8cfa3d4decc34a5..ffb8b3f1eb086a5e3579e42cc41024c85e05d6f0 100644 (file)
@@ -809,7 +809,6 @@ ok:
        return 0;
 }
 
-#ifdef LDAP_X_TXN
 int mdb_txn( Operation *op, int txnop, OpExtra **ptr )
 {
        struct mdb_info *mdb = (struct mdb_info *) op->o_bd->be_private;
@@ -838,7 +837,6 @@ int mdb_txn( Operation *op, int txnop, OpExtra **ptr )
        }
        return LDAP_OTHER;
 }
-#endif
 
 /* Count up the sizes of the components of an entry */
 static int mdb_entry_partsize(struct mdb_info *mdb, MDB_txn *txn, Entry *e,
index e8b39eda5a4f5dde252c49fa10f77e363817c9aa..837f039222e6d3f542bf83424535c4319639fc87 100644 (file)
@@ -394,9 +394,7 @@ mdb_back_initialize(
                LDAP_CONTROL_POST_READ,
                LDAP_CONTROL_SUBENTRIES,
                LDAP_CONTROL_X_PERMISSIVE_MODIFY,
-#ifdef LDAP_X_TXN
-               LDAP_CONTROL_X_TXN_SPEC,
-#endif
+               LDAP_CONTROL_TXN_SPEC,
                NULL
        };
 
index 76e601e5210fa69f306a0561472d4b9d64ebbc23..117310c07793c904563558757acd37e6f575e125 100644 (file)
@@ -573,10 +573,8 @@ mdb_modify( Operation *op, SlapReply *rs )
        Debug( LDAP_DEBUG_ARGS, LDAP_XSTRING(mdb_modify) ": %s\n",
                op->o_req_dn.bv_val );
 
-#ifdef LDAP_X_TXN
        if( op->o_txnSpec && txn_preop( op, rs ))
                return rs->sr_err;
-#endif
 
        ctrls[num_ctrls] = NULL;
 
index d943beb150e63029b75fe47468dce6fea1a934b0..ac2ae4cd9288711c4f2278c3fee3ef441b944b14 100644 (file)
@@ -59,10 +59,8 @@ mdb_modrdn( Operation        *op, SlapReply *rs )
                op->o_req_dn.bv_val,op->oq_modrdn.rs_newrdn.bv_val,
                op->oq_modrdn.rs_newSup ? op->oq_modrdn.rs_newSup->bv_val : "NULL" );
 
-#ifdef LDAP_X_TXN
        if( op->o_txnSpec && txn_preop( op, rs ))
                return rs->sr_err;
-#endif
 
        ctrls[num_ctrls] = NULL;
 
index 5a03126e46b1e4fbeb6e3ba6a8712504aa023316..4b4c4cbd9898634ee920bc43ab3bd5d4114e25cf 100644 (file)
@@ -359,9 +359,7 @@ ndb_back_initialize(
                LDAP_CONTROL_POST_READ,
                LDAP_CONTROL_SUBENTRIES,
                LDAP_CONTROL_X_PERMISSIVE_MODIFY,
-#ifdef LDAP_X_TXN
-               LDAP_CONTROL_X_TXN_SPEC,
-#endif
+               LDAP_CONTROL_TXN_SPEC,
                NULL
        };
 
index 2e1f17f8833267a4ae0b21ddb60ed28ac915934f..e815d5fd2c1ebe8b62df6f510549a4fda070f33a 100644 (file)
@@ -52,10 +52,8 @@ wt_delete( Operation *op, SlapReply *rs )
        Debug( LDAP_DEBUG_ARGS, "==> " LDAP_XSTRING(wt_delete) ": %s\n",
                   op->o_req_dn.bv_val );
 
-#ifdef LDAP_X_TXN
        if( op->o_txnSpec && txn_preop( op, rs ))
                return rs->sr_err;
-#endif
 
        ctrls[num_ctrls] = 0;
        rs->sr_text = NULL;
index 80367d989d35beff2a0c199c8d492bafcf7b30e6..679bb4896018f49f6d670a5bd3ebab1b95396c9b 100644 (file)
@@ -463,10 +463,8 @@ wt_modify( Operation *op, SlapReply *rs )
        Debug( LDAP_DEBUG_ARGS, LDAP_XSTRING(wt_modify) ": %s\n",
                   op->o_req_dn.bv_val );
 
-#ifdef LDAP_X_TXN
        if( op->o_txnSpec && txn_preop( op, rs ))
                return rs->sr_err;
-#endif
 
        ctrls[num_ctrls] = NULL;
 
index 5f029cdce9884433805a85245f01f1d424801f00..5f11a0cf1a67d4f5f47440453efb1f8ba62b98d5 100644 (file)
@@ -382,11 +382,9 @@ Connection * connection_init(
                LDAP_STAILQ_INIT(&c->c_ops);
                LDAP_STAILQ_INIT(&c->c_pending_ops);
 
-#ifdef LDAP_X_TXN
                c->c_txn = CONN_TXN_INACTIVE;
                c->c_txn_backend = NULL;
                LDAP_STAILQ_INIT(&c->c_txn_ops);
-#endif
 
                BER_BVZERO( &c->c_sasl_bind_mech );
                c->c_sasl_done = 0;
@@ -420,11 +418,9 @@ Connection * connection_init(
        assert( BER_BVISNULL( &c->c_peer_name ) );
        assert( LDAP_STAILQ_EMPTY(&c->c_ops) );
        assert( LDAP_STAILQ_EMPTY(&c->c_pending_ops) );
-#ifdef LDAP_X_TXN
        assert( c->c_txn == CONN_TXN_INACTIVE );
        assert( c->c_txn_backend == NULL );
        assert( LDAP_STAILQ_EMPTY(&c->c_txn_ops) );
-#endif
        assert( BER_BVISNULL( &c->c_sasl_bind_mech ) );
        assert( c->c_sasl_done == 0 );
        assert( c->c_sasl_authctx == NULL );
@@ -627,11 +623,9 @@ connection_destroy( Connection *c )
        assert( c->c_conn_state != SLAP_C_INVALID );
        assert( LDAP_STAILQ_EMPTY(&c->c_ops) );
        assert( LDAP_STAILQ_EMPTY(&c->c_pending_ops) );
-#ifdef LDAP_X_TXN
        assert( c->c_txn == CONN_TXN_INACTIVE );
        assert( c->c_txn_backend == NULL );
        assert( LDAP_STAILQ_EMPTY(&c->c_txn_ops) );
-#endif
        assert( c->c_writewaiter == 0);
        assert( c->c_writers == 0);
 
@@ -748,7 +742,6 @@ static void connection_abandon( Connection *c )
                frontendDB->be_abandon( &op, &rs );
        }
 
-#ifdef LDAP_X_TXN
        /* remove operations in pending transaction */
        while ( (o = LDAP_STAILQ_FIRST( &c->c_txn_ops )) != NULL) {
                LDAP_STAILQ_REMOVE_HEAD( &c->c_txn_ops, o_next );
@@ -759,7 +752,6 @@ static void connection_abandon( Connection *c )
        /* clear transaction */
        c->c_txn_backend = NULL;
        c->c_txn = CONN_TXN_INACTIVE;
-#endif
 
        /* remove pending operations */
        while ( (o = LDAP_STAILQ_FIRST( &c->c_pending_ops )) != NULL) {
@@ -1144,7 +1136,6 @@ connection_operation( void *ctx, void *arg_v )
                goto operations_error;
        }
 
-#ifdef LDAP_X_TXN
        if (( conn->c_txn == CONN_TXN_SPECIFY ) && (
                ( tag == LDAP_REQ_ADD ) ||
                ( tag == LDAP_REQ_DELETE ) ||
@@ -1155,9 +1146,7 @@ connection_operation( void *ctx, void *arg_v )
                        issued inside of a transaction */
                op->o_tmpmemctx = NULL;
                op->o_tmpmfuncs = &ch_mfuncs;
-       } else
-#endif
-       {
+       } else {
        /* We can use Thread-Local storage for most mallocs. We can
         * also use TL for ber parsing, but not on Add or Modify.
         */
@@ -1234,10 +1223,7 @@ operations_error:
 
        ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, &memctx_null );
 
-#ifdef LDAP_X_TXN
-       if ( rc != LDAP_X_TXN_SPECIFY_OKAY )
-#endif
-       {
+       if ( rc != LDAP_TXN_SPECIFY_OKAY ) {
                LDAP_STAILQ_REMOVE( &conn->c_ops, op, Operation, o_next);
                LDAP_STAILQ_NEXT(op, o_next) = NULL;
        }
@@ -1255,10 +1241,7 @@ operations_error:
 
        connection_resched( conn );
        ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
-#ifdef LDAP_X_TXN
-       if ( rc != LDAP_X_TXN_SPECIFY_OKAY )
-#endif
-       {
+       if ( rc != LDAP_TXN_SPECIFY_OKAY ) {
                slap_op_free( op, ctx );
        }
        return NULL;
index 1eddfaf7ab370465848ce2cecb9aad9da8825681..56c3a211bed6211b7d91b1e77aa76f14b2a383cf 100644 (file)
@@ -198,13 +198,11 @@ static struct slap_control control_defs[] = {
                SLAP_CTRL_GLOBAL|SLAP_CTRL_UPDATE|SLAP_CTRL_HIDE,
                NULL, NULL,
                parseRelax, LDAP_SLIST_ENTRY_INITIALIZER(next) },
-#ifdef LDAP_X_TXN
-       { LDAP_CONTROL_X_TXN_SPEC,
+       { LDAP_CONTROL_TXN_SPEC,
                (int)offsetof(struct slap_control_ids, sc_txnSpec),
                SLAP_CTRL_UPDATE|SLAP_CTRL_HIDE,
                NULL, NULL,
                txn_spec_ctrl, LDAP_SLIST_ENTRY_INITIALIZER(next) },
-#endif
        { LDAP_CONTROL_MANAGEDSAIT,
                (int)offsetof(struct slap_control_ids, sc_manageDSAit),
                SLAP_CTRL_ACCESS,
@@ -1498,12 +1496,10 @@ parseReadAttrs(
                return LDAP_PROTOCOL_ERROR;
        }
 
-#ifdef LDAP_X_TXN
        if ( op->o_txnSpec ) { /* temporary limitation */
                rs->sr_text = READMSG( post, "cannot perform in transaction" );
                return LDAP_UNWILLING_TO_PERFORM;
        }
-#endif
 
        ber = ber_init( &ctrl->ldctl_value );
        if ( ber == NULL ) {
index 3e584722034656a163252601ab4dd50700a39029..ac1a9fdb21c4de1f7c5ecc14afd3cba5eb95030d 100644 (file)
@@ -98,12 +98,10 @@ do_delete(
                return rs->sr_err;
        }
 
-#ifdef LDAP_X_TXN
-       if( rs->sr_err == LDAP_X_TXN_SPECIFY_OKAY ) {
+       if( rs->sr_err == LDAP_TXN_SPECIFY_OKAY ) {
                /* skip cleanup */
                return rs->sr_err;
        }
-#endif
 
 cleanup:;
        op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
index df35f44be1075156cd37b18328ddd017e6459f67..137d894ff8b584d425b19e5c8c45a811e6940163 100644 (file)
@@ -58,10 +58,8 @@ static struct {
        slap_mask_t flags;
        SLAP_EXTOP_MAIN_FN *ext_main;
 } builtin_extops[] = {
-#ifdef LDAP_X_TXN
        { &slap_EXOP_TXN_START, 0, txn_start_extop },
        { &slap_EXOP_TXN_END, 0, txn_end_extop },
-#endif
        { &slap_EXOP_CANCEL, 0, cancel_extop },
        { &slap_EXOP_WHOAMI, 0, whoami_extop },
        { &slap_EXOP_MODIFY_PASSWD, SLAP_EXOP_WRITES, passwd_extop },
index e651759e5ea4010c330a0729ddd9186e83d08a87..fb1cc3f1c3dfe33455fd5a0a713a28dbb86c07e3 100644 (file)
@@ -177,12 +177,10 @@ do_modify(
                return rs->sr_err;
        }
 
-#ifdef LDAP_X_TXN
-       if( rs->sr_err == LDAP_X_TXN_SPECIFY_OKAY ) {
+       if( rs->sr_err == LDAP_TXN_SPECIFY_OKAY ) {
                /* skip cleanup */
                return rs->sr_err;
        }
-#endif
 
 cleanup:
        op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
index 754eae2f9b67e5e0545974a6b6c0af19e8648d8e..4dd5dce3b8c8ded5f79d9cca38451103b3a999c6 100644 (file)
@@ -189,12 +189,10 @@ do_modrdn(
                /* skip cleanup */
                return rs->sr_err;
        }
-#ifdef LDAP_X_TXN
-       if( rs->sr_err == LDAP_X_TXN_SPECIFY_OKAY ) {
+       if( rs->sr_err == LDAP_TXN_SPECIFY_OKAY ) {
                /* skip cleanup */
                return rs->sr_err;
        }
-#endif
 
 cleanup:
        op->o_tmpfree( op->o_req_dn.bv_val, op->o_tmpmemctx );
index 9f13a9a6004c36f98bef099a50a02ad282826f23..72faf682a35fc30bab0aa143376c926117ddd7d1 100644 (file)
@@ -1069,10 +1069,8 @@ LDAP_SLAPD_V( const struct berval ) slap_EXOP_CANCEL;
 LDAP_SLAPD_V( const struct berval ) slap_EXOP_WHOAMI;
 LDAP_SLAPD_V( const struct berval ) slap_EXOP_MODIFY_PASSWD;
 LDAP_SLAPD_V( const struct berval ) slap_EXOP_START_TLS;
-#ifdef LDAP_X_TXN
 LDAP_SLAPD_V( const struct berval ) slap_EXOP_TXN_START;
 LDAP_SLAPD_V( const struct berval ) slap_EXOP_TXN_END;
-#endif
 
 typedef int (SLAP_EXTOP_MAIN_FN) LDAP_P(( Operation *op, SlapReply *rs ));
 
@@ -1100,12 +1098,10 @@ LDAP_SLAPD_F (struct berval *) get_supported_extop LDAP_P((int index));
 /*
  * txn.c
  */
-#ifdef LDAP_X_TXN
 LDAP_SLAPD_F ( SLAP_CTRL_PARSE_FN ) txn_spec_ctrl;
 LDAP_SLAPD_F ( SLAP_EXTOP_MAIN_FN ) txn_start_extop;
 LDAP_SLAPD_F ( SLAP_EXTOP_MAIN_FN ) txn_end_extop;
 LDAP_SLAPD_F ( int ) txn_preop LDAP_P(( Operation *op, SlapReply *rs ));
-#endif
 
 /*
  * cancel.c
index e151a460171734b51120b2c6355bb02598f0dde2..2a91f50843d3a85b787d715eea642ae1846cb08c 100644 (file)
@@ -2203,13 +2203,11 @@ typedef int (BI_acl_group) LDAP_P(( Operation *op, Entry *target,
 typedef int (BI_acl_attribute) LDAP_P(( Operation *op, Entry *target,
        struct berval *entry_ndn, AttributeDescription *entry_at,
        BerVarray *vals, slap_access_t access ));
-#ifdef LDAP_X_TXN
 struct OpExtra;
 typedef int (BI_op_txn) LDAP_P(( Operation *op, int txnop, struct OpExtra **ptr ));
 #define SLAP_TXN_BEGIN 1
 #define SLAP_TXN_COMMIT        2
 #define SLAP_TXN_ABORT 3
-#endif
 
 typedef int (BI_conn_func) LDAP_P(( BackendDB *bd, Connection *c ));
 typedef BI_conn_func BI_connection_init;
@@ -2308,9 +2306,7 @@ struct BackendInfo {
        BI_operational          *bi_operational;
        BI_chk_referrals        *bi_chk_referrals;
        BI_chk_controls         *bi_chk_controls;
-#ifdef LDAP_X_TXN
        BI_op_txn                       *bi_op_txn;
-#endif
        BI_entry_get_rw         *bi_entry_get_rw;
        BI_entry_release_rw     *bi_entry_release_rw;
 
@@ -2435,9 +2431,7 @@ typedef enum slap_operation_e {
        op_aux_operational,
        op_aux_chk_referrals,
        op_aux_chk_controls,
-#ifdef LDAP_X_TXN
        op_txn,
-#endif
        op_last
 } slap_operation_t;
 
@@ -2516,9 +2510,7 @@ struct slap_control_ids {
 #ifdef SLAP_CONTROL_X_TREE_DELETE
        int sc_treeDelete;
 #endif
-#ifdef LDAP_X_TXN
        int sc_txnSpec;
-#endif
 #ifdef SLAP_CONTROL_X_SESSION_TRACKING
        int sc_sessionTracking;
 #endif
@@ -2791,9 +2783,7 @@ struct Operation {
 #define o_sortedresults                o_ctrlflag[slap_cids.sc_sortedResults]
 #endif
 
-#ifdef LDAP_X_TXN
 #define o_txnSpec              o_ctrlflag[slap_cids.sc_txnSpec]
-#endif
 
 #ifdef SLAP_CONTROL_X_SESSION_TRACKING
 #define o_session_tracking     o_ctrlflag[slap_cids.sc_sessionTracking]
@@ -2962,7 +2952,6 @@ struct Connection {
        void    *c_sasl_cbind;          /* SASL channel binding */
        Operation       *c_sasl_bindop; /* set to current op if it's a bind */
 
-#ifdef LDAP_X_TXN
 #define CONN_TXN_INACTIVE 0
 #define CONN_TXN_SPECIFY 1
 #define CONN_TXN_SETTLE -1
@@ -2970,7 +2959,6 @@ struct Connection {
 
        Backend *c_txn_backend;
        LDAP_STAILQ_HEAD(c_to, Operation) c_txn_ops; /* list of operations in txn */
-#endif
 
        PagedResultsState c_pagedresults_state; /* paged result state */
 
index 02a8fb277e0288dadad896a57ab65d4721a9f580..24871ee431e16dcfefef39cb3008207388ffd644 100644 (file)
@@ -27,9 +27,8 @@
 #include <lber_pvt.h>
 #include <lutil.h>
 
-#ifdef LDAP_X_TXN
-const struct berval slap_EXOP_TXN_START = BER_BVC(LDAP_EXOP_X_TXN_START);
-const struct berval slap_EXOP_TXN_END = BER_BVC(LDAP_EXOP_X_TXN_END);
+const struct berval slap_EXOP_TXN_START = BER_BVC(LDAP_EXOP_TXN_START);
+const struct berval slap_EXOP_TXN_END = BER_BVC(LDAP_EXOP_TXN_END);
 
 int txn_start_extop(
        Operation *op, SlapReply *rs )
@@ -95,7 +94,7 @@ int txn_spec_ctrl(
        }
        if ( ctrl->ldctl_value.bv_len != 0 ) {
                rs->sr_text = "invalid transaction identifier";
-               return LDAP_X_TXN_ID_INVALID;
+               return LDAP_TXN_ID_INVALID;
        }
 
        if ( op->o_preread ) { /* temporary limitation */
@@ -208,7 +207,7 @@ int txn_end_extop(
 
        if( txnid.bv_len ) {
                rs->sr_text = "invalid transaction identifier";
-               return LDAP_X_TXN_ID_INVALID;
+               return LDAP_TXN_ID_INVALID;
        }
 
        /* acquire connection lock */
@@ -216,7 +215,7 @@ int txn_end_extop(
 
        if( c->c_txn != CONN_TXN_SPECIFY ) {
                rs->sr_text = "invalid transaction identifier";
-               rc = LDAP_X_TXN_ID_INVALID;
+               rc = LDAP_TXN_ID_INVALID;
                goto done;
        }
        c->c_txn = CONN_TXN_SETTLE;
@@ -331,7 +330,7 @@ int txn_preop( Operation *op, SlapReply *rs )
        ldap_pvt_thread_mutex_lock( &op->o_conn->c_mutex );
        if( op->o_conn->c_txn == CONN_TXN_INACTIVE ) {
                rs->sr_text = "invalid transaction identifier";
-               rs->sr_err = LDAP_X_TXN_ID_INVALID;
+               rs->sr_err = LDAP_TXN_ID_INVALID;
                goto txnReturn;
        } else if( op->o_conn->c_txn == CONN_TXN_SETTLE ) {
                settle=1;
@@ -358,10 +357,8 @@ txnReturn:
        if( !settle ) {
                send_ldap_result( op, rs );
                if ( !rs->sr_err )
-                       rs->sr_err = LDAP_X_TXN_SPECIFY_OKAY;
+                       rs->sr_err = LDAP_TXN_SPECIFY_OKAY;
                return rs->sr_err;
        }
        return LDAP_SUCCESS;    /* proceed with operation */
 }
-
-#endif /* LDAP_X_TXN */