Remove LDAP_X_TXN and rename accordingly

This commit is contained in:
Ondřej Kuzník 2020-01-28 11:50:33 +00:00
parent 0cf2b12154
commit 76c43165ea
23 changed files with 37 additions and 143 deletions

View 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",

View 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

View 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"));

View 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

View 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;

View 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;

View 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;

View 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,

View 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
};

View 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;

View 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;

View 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
};

View 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;

View 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;

View 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;

View 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 ) {

View 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 );

View 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 },

View 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 );

View 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 );

View 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

View 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 */

View 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 */