]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/acl.c
Fixed last commit. gcc was complaining about defined behavior.
[openldap] / servers / slapd / acl.c
index 99bb8364e73064d9a6e7f87be03e046aa062661e..ef85ad2614e8ab6617bf1f04bdcdf6a1dc4b502b 100644 (file)
@@ -1990,8 +1990,15 @@ acl_check_modlist(
                        /* fall thru to check value to add */
 
                case LDAP_MOD_ADD:
+               case SLAP_MOD_ADD_IF_NOT_PRESENT:
                        assert( mlist->sml_values != NULL );
 
+                       if ( mlist->sml_op == SLAP_MOD_ADD_IF_NOT_PRESENT
+                               && attr_find( e->e_attrs, mlist->sml_desc ) )
+                       {
+                               break;
+                       }
+
                        for ( bv = mlist->sml_nvalues
                                        ? mlist->sml_nvalues : mlist->sml_values;
                                bv->bv_val != NULL; bv++ )
@@ -2008,6 +2015,7 @@ acl_check_modlist(
                        break;
 
                case LDAP_MOD_DELETE:
+               case SLAP_MOD_SOFTDEL:
                        if ( mlist->sml_values == NULL ) {
                                if ( ! access_allowed( op, e,
                                        mlist->sml_desc, NULL,