]> git.sur5r.net Git - openldap/commitdiff
No need to check attribute values when a is NULL
authorKurt Zeilenga <kurt@openldap.org>
Thu, 8 Apr 2004 19:56:50 +0000 (19:56 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 8 Apr 2004 19:56:50 +0000 (19:56 +0000)
servers/slapd/mods.c

index 8a40ef301a46fc5904e715034e36832c0f1f66ff..c75d4208c3d52bd322c29f9ec26f5b137061aa0c 100644 (file)
@@ -73,29 +73,9 @@ modify_add_values(
                                "modify/%s: %s: no equality matching rule",
                                op, mod->sm_desc->ad_cname.bv_val );
                        return LDAP_INAPPROPRIATE_MATCHING;
-               }
-
-               for ( i = 0; mod->sm_values[i].bv_val != NULL; i++ ) {
-                       /* test asserted values against existing values */
-                       for( matched = 0, j = 0; a->a_vals[j].bv_val != NULL; j++ ) {
-                               if ( bvmatch( &mod->sm_values[i], &a->a_vals[j] ) ) {
-                                       if ( permissive ) {
-                                               matched++;
-                                               continue;
-                                       }
-                                       /* value exists already */
-                                       *text = textbuf;
-                                       snprintf( textbuf, textlen,
-                                               "modify/%s: %s: value #%i already exists",
-                                               op, mod->sm_desc->ad_cname.bv_val, j );
-                                       return LDAP_TYPE_OR_VALUE_EXISTS;
-                               }
-                       }
 
-                       if ( permissive && matched == j ) {
-                               /* values already exist; do nothing */
-                               return LDAP_SUCCESS;
-                       }
+               } else {
+                       return LDAP_SUCCESS;
                }
 
        } else if ( a != NULL ) {