]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/acl.c
Partial revert of f30269f5d2e4bb5ee7486fe6542078d1b59dba6d
[openldap] / servers / slapd / acl.c
index 99bb8364e73064d9a6e7f87be03e046aa062661e..92b4c43b03b5bbad33f2b188aef715e54f85774b 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2011 The OpenLDAP Foundation.
+ * Copyright 1998-2012 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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,