]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-passwd/search.c
component cleanup
[openldap] / servers / slapd / back-passwd / search.c
index 1932583d17a1c5d2e0a2c7785159b9bd36ea331d..1317459fd5b2fb227bff4bfd897969ff6c14cc16 100644 (file)
@@ -65,15 +65,13 @@ passwd_back_search(
        time_t          stoptime;
 
        LDAPRDN rdn = NULL;
-       struct berval parent = { 0, NULL };
+       struct berval parent = BER_BVNULL;
 
        AttributeDescription *ad_objectClass = slap_schema.si_ad_objectClass;
 
-       op->ors_tlimit = (op->ors_tlimit > op->o_bd->be_timelimit || op->ors_tlimit < 1) ? op->o_bd->be_timelimit
-           : op->ors_tlimit;
-       stoptime = op->o_time + op->ors_tlimit;
-       op->ors_slimit = (op->ors_slimit > op->o_bd->be_sizelimit || op->ors_slimit < 1) ? op->o_bd->be_sizelimit
-           : op->ors_slimit;
+       if (op->ors_tlimit != SLAP_NO_LIMIT ) {
+               stoptime = op->o_time + op->ors_tlimit;
+       }
 
        /* Handle a query for the base of this backend */
        if ( be_issuffix( op->o_bd, &op->o_req_ndn ) ) {
@@ -131,6 +129,7 @@ passwd_back_search(
                        if ( test_filter( op, e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
                                rs->sr_entry = e;
                                rs->sr_attrs = op->ors_attrs;
+                               rs->sr_flags = REP_ENTRY_MODIFIABLE;
                                send_search_entry( op, rs );
                        }
                }
@@ -149,7 +148,9 @@ passwd_back_search(
                                }
 
                                /* check time limit */
-                               if ( slap_get_time() > stoptime ) {
+                               if ( op->ors_tlimit != SLAP_NO_LIMIT
+                                               && slap_get_time() > stoptime )
+                               {
                                        send_ldap_error( op, rs, LDAP_TIMELIMIT_EXCEEDED, NULL );
                                        endpwent();
                                        ldap_pvt_thread_mutex_unlock( &passwd_mutex );
@@ -174,6 +175,7 @@ passwd_back_search(
 
                                        rs->sr_entry = e;
                                        rs->sr_attrs = op->ors_attrs;
+                                       rs->sr_flags = REP_ENTRY_MODIFIABLE;
                                        send_search_entry( op, rs );
                                }
 
@@ -233,6 +235,7 @@ passwd_back_search(
                if ( test_filter( op, e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
                        rs->sr_entry = e;
                        rs->sr_attrs = op->ors_attrs;
+                       rs->sr_flags = REP_ENTRY_MODIFIABLE;
                        send_search_entry( op, rs );
                }