Disallow pre/post reads in transactions (haven't yet specified

protocol mechanism to return update response controls).
This commit is contained in:
Kurt Zeilenga 2006-03-07 20:31:46 +00:00
parent e30be8748a
commit 8788a2af36
2 changed files with 19 additions and 0 deletions

View File

@ -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";

View File

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