From: Kurt Zeilenga Date: Tue, 7 Mar 2006 20:31:46 +0000 (+0000) Subject: Disallow pre/post reads in transactions (haven't yet specified X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~133 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8788a2af3663988d71c57b6c0e39622299b823fc;p=openldap Disallow pre/post reads in transactions (haven't yet specified protocol mechanism to return update response controls). --- diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index cf4cfa930f..5d9d73f412 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -1208,6 +1208,11 @@ static int parsePreRead ( return LDAP_PROTOCOL_ERROR; } + if ( op->o_txnSpec ) { /* temporary limitation */ + rs->sr_text = "cannot perform pre-read in transaction"; + return LDAP_UNWILLING_TO_PERFORM; + } + ber = ber_init( &(ctrl->ldctl_value) ); if (ber == NULL) { rs->sr_text = "preread control: internal error"; @@ -1266,6 +1271,11 @@ static int parsePostRead ( return LDAP_PROTOCOL_ERROR; } + if ( op->o_txnSpec ) { /* temporary limitation */ + rs->sr_text = "cannot perform post-read in transaction"; + return LDAP_UNWILLING_TO_PERFORM; + } + ber = ber_init( &(ctrl->ldctl_value) ); if (ber == NULL) { rs->sr_text = "postread control: internal error"; diff --git a/servers/slapd/txn.c b/servers/slapd/txn.c index f8fb65785d..03cc7e337a 100644 --- a/servers/slapd/txn.c +++ b/servers/slapd/txn.c @@ -99,6 +99,15 @@ int txn_spec_ctrl( return LDAP_X_TXN_ID_INVALID; } + if ( op->o_preread ) { /* temporary limitation */ + rs->sr_text = "cannot perform pre-read in transaction"; + return LDAP_UNWILLING_TO_PERFORM; + } + if ( op->o_postread ) { /* temporary limitation */ + rs->sr_text = "cannot perform post-read in transaction"; + return LDAP_UNWILLING_TO_PERFORM; + } + op->o_txnSpec = SLAP_CONTROL_CRITICAL; return LDAP_SUCCESS; }