/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include "slap.h"
#include "back-passwd.h"
-#include <ldap_pvt.h>
static void pw_start( Backend *be );
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->oq_search.rs_tlimit = (op->oq_search.rs_tlimit > op->o_bd->be_timelimit || op->oq_search.rs_tlimit < 1) ? op->o_bd->be_timelimit
- : op->oq_search.rs_tlimit;
- stoptime = op->o_time + op->oq_search.rs_tlimit;
- op->oq_search.rs_slimit = (op->oq_search.rs_slimit > op->o_bd->be_sizelimit || op->oq_search.rs_slimit < 1) ? op->o_bd->be_sizelimit
- : op->oq_search.rs_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 ) ) {
rs->sr_matched = op->o_req_dn.bv_val;
- if( op->oq_search.rs_scope != LDAP_SCOPE_ONELEVEL ) {
+ if( op->ors_scope != LDAP_SCOPE_ONELEVEL ) {
AttributeDescription *desc = NULL;
/* Create an entry corresponding to the base DN */
vals[0].bv_len = sizeof("organizationalUnit")-1;
attr_mergeit( e, ad_objectClass, vals );
- if ( test_filter( op, e, op->oq_search.rs_filter ) == LDAP_COMPARE_TRUE ) {
+ if ( test_filter( op, e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
rs->sr_entry = e;
- rs->sr_attrs = op->oq_search.rs_attrs;
+ rs->sr_attrs = op->ors_attrs;
+ rs->sr_flags = REP_ENTRY_MODIFIABLE;
send_search_entry( op, rs );
}
}
- if ( op->oq_search.rs_scope != LDAP_SCOPE_BASE ) {
+ if ( op->ors_scope != LDAP_SCOPE_BASE ) {
/* check all our "children" */
ldap_pvt_thread_mutex_lock( &passwd_mutex );
if ( op->o_abandon ) {
endpwent();
ldap_pvt_thread_mutex_unlock( &passwd_mutex );
- return( -1 );
+ return( SLAPD_ABANDON );
}
/* 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 );
goto done;
}
- if ( test_filter( op, e, op->oq_search.rs_filter ) == LDAP_COMPARE_TRUE ) {
+ if ( test_filter( op, e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
/* check size limit */
- if ( --op->oq_search.rs_slimit == -1 ) {
+ if ( --op->ors_slimit == -1 ) {
send_ldap_error( op, rs, LDAP_SIZELIMIT_EXCEEDED, NULL );
endpwent();
ldap_pvt_thread_mutex_unlock( &passwd_mutex );
}
rs->sr_entry = e;
- rs->sr_attrs = op->oq_search.rs_attrs;
+ rs->sr_attrs = op->ors_attrs;
+ rs->sr_flags = REP_ENTRY_MODIFIABLE;
send_search_entry( op, rs );
}
goto done;
}
- if( op->oq_search.rs_scope == LDAP_SCOPE_ONELEVEL ) {
+ if( op->ors_scope == LDAP_SCOPE_ONELEVEL ) {
goto done;
}
goto done;
}
- if ( test_filter( op, e, op->oq_search.rs_filter ) == LDAP_COMPARE_TRUE ) {
+ if ( test_filter( op, e, op->ors_filter ) == LDAP_COMPARE_TRUE ) {
rs->sr_entry = e;
- rs->sr_attrs = op->oq_search.rs_attrs;
+ rs->sr_attrs = op->ors_attrs;
+ rs->sr_flags = REP_ENTRY_MODIFIABLE;
send_search_entry( op, rs );
}