]> git.sur5r.net Git - openldap/commitdiff
harmonize back-ldbm and back-bdb handling of searchBase disclose access; fixes ITS...
authorPierangelo Masarati <ando@openldap.org>
Tue, 23 Aug 2005 17:38:50 +0000 (17:38 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 23 Aug 2005 17:38:50 +0000 (17:38 +0000)
servers/slapd/back-bdb/search.c
servers/slapd/back-ldbm/search.c
tests/scripts/test041-aci

index 12d7ea3eb6f9e503791565bb3f64dde34ca70120..f05b725b2698ad04a5b389049e8a8f3bf58afadf 100644 (file)
@@ -477,7 +477,7 @@ dn2entry_retry:
                        bdb_cache_return_entry_r(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
                }
                send_ldap_result( op, rs );
-               return 1;
+               return rs->sr_err;
        }
 #endif /* SLAP_ACL_HONOR_DISCLOSE */
 
index 94dd13553f633cf2c0388786d593d17e390bfe13..47e7886ee1a945c131ec298c6c3fd7f866b90fb2 100644 (file)
@@ -47,6 +47,9 @@ ldbm_back_search(
        Entry   *matched = NULL;
        struct berval   realbase = BER_BVNULL;
        int             manageDSAit = get_manageDSAit( op );
+#ifdef SLAP_ACL_HONOR_DISCLOSE
+       slap_mask_t     mask;
+#endif
 
        Debug(LDAP_DEBUG_TRACE, "=> ldbm_back_search\n", 0, 0, 0);
 
@@ -130,10 +133,16 @@ ldbm_back_search(
        }
 
 #ifdef SLAP_ACL_HONOR_DISCLOSE
-       if ( ! access_allowed( op, e, slap_schema.si_ad_entry,
-                               NULL, ACL_DISCLOSE, NULL ) )
+       /* NOTE: __NEW__ "search" access is required
+        * on searchBase object */
+       if ( ! access_allowed_mask( op, e, slap_schema.si_ad_entry,
+                               NULL, ACL_SEARCH, NULL, &mask ) )
        {
-               rs->sr_err = LDAP_NO_SUCH_OBJECT;
+               if ( !ACL_GRANT( mask, ACL_DISCLOSE ) ) {
+                       rs->sr_err = LDAP_NO_SUCH_OBJECT;
+               } else {
+                       rs->sr_err = LDAP_INSUFFICIENT_ACCESS;
+               }
 
                cache_return_entry_r( &li->li_cache, e );
                ldap_pvt_thread_rdwr_runlock(&li->li_giant_rwlock);
index 5e6ec138bb5e1ef75a216ef0f21b7f655db4115d..0329c5ccae3c053d70eef8dca246ff5f3d9fe819 100755 (executable)
@@ -136,9 +136,9 @@ $LDAPSEARCH -s base -b "$BASEDN" -h $LOCALHOST -p $PORT1 \
        '(objectclass=*)' >> $SEARCHOUT 2>> $TESTOUT
 RC=$?
 if test $RC != 0 ; then
-       echo "ldapsearch failed ($RC)!"
-       echo "IGNORED"
-       ### TEMPORARILY DISABLED
+       ### TEMPORARY (see ITS#3963)
+       echo "ldapsearch failed ($RC)! IGNORED..."
+       ###echo "ldapsearch failed ($RC)!"
        ###test $KILLSERVERS != no && kill -HUP $KILLPIDS
        ###exit $RC
 fi