]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/modify.c
refine fix to ITS#4315; apply it to back-meta as well
[openldap] / servers / slapd / back-meta / modify.c
index 379a1e03ec780f26ce9bf8066613d76001abe438..fd54c03fcca7f4b88832cbf321540f020f0eb33e 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2005 The OpenLDAP Foundation.
+ * Copyright 1999-2006 The OpenLDAP Foundation.
  * Portions Copyright 2001-2003 Pierangelo Masarati.
  * Portions Copyright 1999-2003 Howard Chu.
  * All rights reserved.
@@ -89,7 +89,8 @@ meta_back_modify( Operation *op, SlapReply *rs )
        for ( i = 0, ml = op->orm_modlist; ml; ml = ml->sml_next ) {
                int     j, is_oc = 0;
 
-               if ( !isupdate && ml->sml_desc->ad_type->sat_no_user_mod  ) {
+               if ( !isupdate && !get_manageDIT( op ) && ml->sml_desc->ad_type->sat_no_user_mod  )
+               {
                        continue;
                }
 
@@ -185,17 +186,17 @@ retry:;
                struct timeval  tv, *tvp = NULL;
                LDAPMessage     *res = NULL;
 
-               if ( mi->mi_targets[ candidate ].mt_timeout[ META_OP_MODIFY ] != 0 ) {
-                       tv.tv_sec = mi->mi_targets[ candidate ].mt_timeout[ META_OP_MODIFY ];
+               if ( mi->mi_targets[ candidate ].mt_timeout[ LDAP_BACK_OP_MODIFY ] != 0 ) {
+                       tv.tv_sec = mi->mi_targets[ candidate ].mt_timeout[ LDAP_BACK_OP_MODIFY ];
                        tv.tv_usec = 0;
                        tvp = &tv;
                }
 
-               rs->sr_err = ldap_result( mc->mc_conns[ candidate ].msc_ld,
-                       msgid, LDAP_MSG_ONE, tvp, &res );
-               switch ( rs->sr_err ) {
+               rs->sr_err = LDAP_OTHER;
+               rc = ldap_result( mc->mc_conns[ candidate ].msc_ld,
+                       msgid, LDAP_MSG_ALL, tvp, &res );
+               switch ( rc ) {
                case -1:
-                       rs->sr_err = LDAP_OTHER;
                        rc = -1;
                        break;
 
@@ -207,7 +208,17 @@ retry:;
                        rc = -1;
                        break;
 
+               case LDAP_RES_MODIFY:
+                       rc = ldap_parse_result( mc->mc_conns[ candidate ].msc_ld,
+                               res, &rs->sr_err, NULL, NULL, NULL, NULL, 1 );
+                       if ( rc != LDAP_SUCCESS ) {
+                               rs->sr_err = rc;
+                       }
+                       rc = 0;
+                       break;
+
                default:
+                       rc = -1;
                        ldap_msgfree( res );
                        break;
                }