]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sql/modify.c
re-fix previus commit the other way 'round (rids are < 1000)
[openldap] / servers / slapd / back-sql / modify.c
index c6c84b0c02a54568f1c1b2a2ed104e109949f90a..4ee11dbd58e7bccda9df2e64fdecc73f7526bc05 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2006 The OpenLDAP Foundation.
+ * Copyright 1999-2007 The OpenLDAP Foundation.
  * Portions Copyright 1999 Dmitry Kovalev.
  * Portions Copyright 2002 Pierangelo Masarati.
  * All rights reserved.
@@ -152,10 +152,10 @@ backsql_modify( Operation *op, SlapReply *rs )
                        goto do_transact;
                }
 
-               rs->sr_err = entry_schema_check( op, &m, NULL, 0,
+               rs->sr_err = entry_schema_check( op, &m, NULL, 0, 0,
                        &rs->sr_text, textbuf, sizeof( textbuf ) );
                if ( rs->sr_err != LDAP_SUCCESS ) {
-                       Debug( LDAP_DEBUG_TRACE, "   backsql_add(\"%s\"): "
+                       Debug( LDAP_DEBUG_TRACE, "   backsql_modify(\"%s\"): "
                                "entry failed schema check -- aborting\n",
                                m.e_name.bv_val, 0, 0 );
                        e = NULL;
@@ -168,13 +168,13 @@ do_transact:;
         * Commit only if all operations succeed
         */
        if ( rs->sr_err == LDAP_SUCCESS && !op->o_noop ) {
+               assert( e == NULL );
                CompletionType = SQL_COMMIT;
        }
 
        SQLTransact( SQL_NULL_HENV, dbh, CompletionType );
 
 done:;
-#ifdef SLAP_ACL_HONOR_DISCLOSE
        if ( e != NULL ) {
                if ( !access_allowed( op, e, slap_schema.si_ad_entry, NULL,
                                        ACL_DISCLOSE, NULL ) )
@@ -188,7 +188,10 @@ done:;
                        }
                }
        }
-#endif /* SLAP_ACL_HONOR_DISCLOSE */
+
+       if ( op->o_noop && rs->sr_err == LDAP_SUCCESS ) {
+               rs->sr_err = LDAP_X_NO_OPERATION;
+       }
 
        send_ldap_result( op, rs );
        slap_graduate_commit_csn( op );