]> git.sur5r.net Git - openldap/commitdiff
don't return entry if requested attr is not present (ITS#5650) LOCKER_IDS
authorPierangelo Masarati <ando@openldap.org>
Sat, 9 Aug 2008 16:04:55 +0000 (16:04 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 9 Aug 2008 16:04:55 +0000 (16:04 +0000)
servers/slapd/back-bdb/id2entry.c

index 15da6c76594732a4529d224aea5afc529d75f8d1..76ad30ce3bf9a90cd92195bd2112674068df8d6a 100644 (file)
@@ -401,6 +401,15 @@ dn2entry_retry:
                goto return_results;
        }
 
+       /* NOTE: attr_find() or attrs_find()? */
+       if ( at && attr_find( e->e_attrs, at ) == NULL ) {
+               Debug( LDAP_DEBUG_ACL,
+                       "<= bdb_entry_get: failed to find attribute %s\n",
+                       at->ad_cname.bv_val, 0, 0 ); 
+               rc = LDAP_NO_SUCH_ATTRIBUTE;
+               goto return_results;
+       }
+
 return_results:
        if( rc != LDAP_SUCCESS ) {
                /* free entry */