]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/result.c
Removed o_suffix and o_suffixalias as they were 1) leaked and 2) unused
[openldap] / servers / slapd / result.c
index a18ba20a8611ba266c2c212f56e5310cb54e294f..12e90a805b2e8f514934538d2b80bfabf330a1bd 100644 (file)
@@ -116,6 +116,10 @@ send_ldap_result2(
                pthread_kill( listener_tid, LDAP_SIGUSR1 );
 
                pthread_cond_wait( &conn->c_wcv, &active_threads_mutex );
+
+               if( active_threads < 1 ) {
+                       pthread_cond_signal(&active_threads_cond);
+               }
                pthread_mutex_unlock( &active_threads_mutex );
 
                pthread_yield();
@@ -189,14 +193,15 @@ send_search_entry(
 
        Debug( LDAP_DEBUG_TRACE, "=> send_search_entry (%s)\n", e->e_dn, 0, 0 );
 
-       if ( ! access_allowed( be, conn, op, e, "entry", NULL, op->o_dn,
-           ACL_READ ) ) {
+       if ( ! access_allowed( be, conn, op, e,
+               "entry", NULL, ACL_READ ) )
+       {
                Debug( LDAP_DEBUG_ACL, "acl: access to entry not allowed\n",
                    0, 0, 0 );
                return( 1 );
        }
 
-       edn = dn_normalize_case( strdup( e->e_dn ) );
+       edn = e->e_ndn;
 
 #ifdef LDAP_COMPAT30
        if ( (ber = ber_alloc_t( conn->c_version == 30 ? 0 : LBER_USE_DER ))
@@ -247,12 +252,12 @@ send_search_entry(
                                a->a_type, 0, 0 );
                        acl = NULL;
                } else {
-                       acl = acl_get_applicable( be, op, e, a->a_type, edn,
+                       acl = acl_get_applicable( be, op, e, a->a_type,
                                MAXREMATCHES, matches );
                }
 
-               if ( ! acl_access_allowed( acl, be, conn, e, NULL, op, ACL_READ,
-                       edn, matches ) ) 
+               if ( ! acl_access_allowed( acl, be, conn, e,
+                       NULL, op, ACL_READ, edn, matches ) ) 
                {
                        continue;
                }
@@ -298,8 +303,6 @@ send_search_entry(
                }
        }
 
-       free(edn);
-
 #ifdef LDAP_COMPAT30
        if ( conn->c_version == 30 ) {
                rc = ber_printf( ber, "}}}}" );
@@ -346,6 +349,10 @@ send_search_entry(
                conn->c_writewaiter = 1;
                pthread_kill( listener_tid, LDAP_SIGUSR1 );
                pthread_cond_wait( &conn->c_wcv, &active_threads_mutex );
+
+               if( active_threads < 1 ) {
+                       pthread_cond_signal(&active_threads_cond);
+               }
                pthread_mutex_unlock( &active_threads_mutex );
 
                pthread_yield();
@@ -374,7 +381,6 @@ send_search_entry(
        return( rc );
 
 error_return:;
-       free(edn);
        return( 1 );
 }