]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/acl.c
don't return entry if requested attr is not present (ITS#5650)
[openldap] / servers / slapd / acl.c
index 7f97d57cf4c0bc5e9cc14e482c3aaec76f7aff2c..5913ea9907e0456ce8ea4f5453011284d6ba4537 100644 (file)
@@ -2114,7 +2114,7 @@ acl_set_gather( SetCookie *cookie, struct berval *name, AttributeDescription *de
        if ( rc != LDAP_SUCCESS ) {
                Debug( LDAP_DEBUG_TRACE,
                        "%s acl_set_gather: DN=\"%s\" normalize failed\n",
-                       cp->asc_op->o_log_prefix, op2.o_req_dn.bv_val, 0 );
+                       cp->asc_op->o_log_prefix, ludp->lud_dn, 0 );
 
                goto url_done;
        }
@@ -2275,7 +2275,7 @@ acl_match_set (
        AclSetCookie    cookie;
 
        if ( default_set_attribute == NULL ) {
-               ber_dupbv_x( &set, subj, op->o_tmpmemctx );
+               set = *subj;
 
        } else {
                struct berval           subjdn, ndn = BER_BVNULL;
@@ -2324,7 +2324,9 @@ acl_match_set (
                        acl_set_gather,
                        (SetCookie *)&cookie, &set,
                        &op->o_ndn, &e->e_nname, NULL ) > 0 );
-               slap_sl_free( set.bv_val, op->o_tmpmemctx );
+               if ( set.bv_val != subj->bv_val ) {
+                       slap_sl_free( set.bv_val, op->o_tmpmemctx );
+               }
        }
 
        return(rc);