]> git.sur5r.net Git - openldap/commitdiff
Disallow pre/post reads in transactions (haven't yet specified
authorKurt Zeilenga <kurt@openldap.org>
Tue, 7 Mar 2006 20:31:46 +0000 (20:31 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 7 Mar 2006 20:31:46 +0000 (20:31 +0000)
protocol mechanism to return update response controls).

servers/slapd/controls.c
servers/slapd/txn.c

index cf4cfa930feae42e22a7192d9b819e7aa1e6f526..5d9d73f4123a509b18a9a05c52ed01f33c8f3b79 100644 (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";
index f8fb65785d1f1017e594d0ca947de46177cf59a2..03cc7e337a675e15eaca82c42713d146c1c530d1 100644 (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;
 }