]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/mods.c
Fix prev commit
[openldap] / servers / slapd / mods.c
index 02d4bcb207883a7fe5daddb40b5731d1fc092447..c2d74ba4d62e6c68ab5c012660078dd5804c6ca1 100644 (file)
@@ -1,9 +1,18 @@
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2004 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
-/*
- * Copyright (c) 1995 Regents of the University of Michigan.
+/* Portions Copyright (c) 1995 Regents of the University of Michigan.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms are permitted
@@ -216,6 +225,7 @@ modify_delete_values(
        Attribute       *a;
        MatchingRule    *mr = mod->sm_desc->ad_type->sat_equality;
        char            dummy = '\0';
+       int                     match = 0;
 
        /*
         * If permissive is set, then the non-existence of an 
@@ -264,7 +274,6 @@ modify_delete_values(
        for ( i = 0; mod->sm_values[i].bv_val != NULL; i++ ) {
                int     found = 0;
                for ( j = 0; a->a_vals[j].bv_val != NULL; j++ ) {
-                       int match;
 
                        if( mod->sm_nvalues ) {
                                assert( a->a_nvals );
@@ -291,7 +300,7 @@ modify_delete_values(
                                snprintf( textbuf, textlen,
                                        "%s: matching rule failed",
                                        mod->sm_desc->ad_cname.bv_val );
-                               goto return_results;
+                               break;
                        }
 
                        if ( match != 0 ) {
@@ -317,7 +326,11 @@ modify_delete_values(
                                "modify/delete: %s: no such value",
                                mod->sm_desc->ad_cname.bv_val );
                        rc = LDAP_NO_SUCH_ATTRIBUTE;
-                       goto return_results;
+                       if ( i > 0 ) {
+                               break;
+                       } else {
+                               goto return_results;
+                       }
                }
        }