]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slapi/slapi_ops.c
Tweak online_index task interval
[openldap] / servers / slapd / slapi / slapi_ops.c
index 4b7b02ae794062f38ff52befd7fb55285d8b8226..3e32409ecf40e4adf29a0995d9fdf769ab298acf 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2002-2004 The OpenLDAP Foundation.
+ * Copyright 2002-2005 The OpenLDAP Foundation.
  * Portions Copyright 1997,2002-2003 IBM Corporation.
  * All rights reserved.
  *
@@ -450,16 +450,24 @@ slapi_int_ldapmod_to_entry(
        } else {
                int repl_user = be_isupdate_dn( op->o_bd, &op->o_bd->be_rootdn );
                if ( !op->o_bd->be_update_ndn.bv_len || repl_user ) {
-                       int update = op->o_bd->be_update_ndn.bv_len;
-                       char textbuf[SLAP_TEXT_BUFLEN];
-                       size_t textlen = sizeof textbuf;
+                       int     update = !BER_BVISNULL( &op->o_bd->be_update_ndn );
+                       char    textbuf[ SLAP_TEXT_BUFLEN ];
+                       size_t  textlen = sizeof( textbuf );
 
-                       rc = slap_mods_check( modlist, update, &text, 
+                       rc = slap_mods_check( modlist, &text, 
                                        textbuf, textlen, NULL );
                        if ( rc != LDAP_SUCCESS) {
                                goto cleanup;
                        }
 
+                       if ( !update ) {
+                               rc = slap_mods_no_update_check( modlist,
+                                               &text, textbuf, textlen );
+                               if ( rc != LDAP_SUCCESS) {
+                                       goto cleanup;
+                               }
+                       }
+
                        if ( !repl_user ) {
                                rc = slap_mods_opattrs( op,
                                                modlist, modtail, &text, 
@@ -995,6 +1003,7 @@ slapi_modify_internal(
                /* fall through */
                case LDAP_MOD_DELETE:
                case LDAP_MOD_REPLACE:
+               case LDAP_MOD_INCREMENT:
                break;
 
                default:
@@ -1014,18 +1023,26 @@ slapi_modify_internal(
        if ( op->o_bd->be_modify ) {
                int repl_user = be_isupdate( op );
                if ( !op->o_bd->be_update_ndn.bv_len || repl_user ) {
-                       int update = op->o_bd->be_update_ndn.bv_len;
-                       const char *text = NULL;
-                       char textbuf[SLAP_TEXT_BUFLEN];
-                       size_t textlen = sizeof( textbuf );
-                       slap_callback cb = { NULL, slap_replog_cb, NULL, NULL };
+                       int             update = !BER_BVISEMPTY( &op->o_bd->be_update_ndn );
+                       const char      *text = NULL;
+                       char            textbuf[ SLAP_TEXT_BUFLEN ];
+                       size_t          textlen = sizeof( textbuf );
+                       slap_callback   cb = { NULL, slap_replog_cb, NULL, NULL };
 
-                       rs.sr_err = slap_mods_check( modlist, update,
+                       rs.sr_err = slap_mods_check( modlist,
                                        &text, textbuf, textlen, NULL );
                        if ( rs.sr_err != LDAP_SUCCESS ) {
                                goto cleanup;
                        }
 
+                       if ( !update ) {
+                               rs.sr_err = slap_mods_no_update_check( modlist,
+                                               &text, textbuf, textlen );
+                               if ( rs.sr_err != LDAP_SUCCESS ) {
+                                       goto cleanup;
+                               }
+                       }
+
                        if ( !repl_user ) {
                                rs.sr_err = slap_mods_opattrs( op, modlist,
                                                modtail, &text, textbuf,