]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/add.c
Make sur attribute ACL are evaluated on ADD operations (see ITS#4556)
[openldap] / servers / slapd / back-bdb / add.c
index d6fba1bdd2e22c5ab52eff976dfec4cf3e5fbfa5..b9f7fedc7893f64c3a800328a9d1cb275ba30eaa 100644 (file)
@@ -299,6 +299,24 @@ retry:     /* transaction retry */
                goto return_results;;
        }
 
+       /* 
+        * Check ACL for attribute write access
+        */
+       if (!acl_check_modlist(op, oe, op->ora_modlist)) {
+               switch( opinfo.boi_err ) {
+               case DB_LOCK_DEADLOCK:
+               case DB_LOCK_NOTGRANTED:
+                       goto retry;
+               }
+
+               Debug( LDAP_DEBUG_TRACE,
+                       LDAP_XSTRING(bdb_add) ": no write access to attribute\n",
+                       0, 0, 0 );
+               rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
+               rs->sr_text = "no write access to attribute";
+               goto return_results;;
+       }
+
        if ( eid == NOID ) {
                rs->sr_err = bdb_next_id( op->o_bd, &eid );
                if( rs->sr_err != 0 ) {