Lines Matching refs:op

40     Operation	*op,	/* info about the op to which we're responding */
47 op->o_log_prefix, 0, 0 );
74 if ( ber_scanf( op->o_ber, "{miiiib" /*}*/,
75 &base, &op->ors_scope, &op->ors_deref, &op->ors_slimit,
76 &op->ors_tlimit, &op->ors_attrsonly ) == LBER_ERROR )
78 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
83 if ( op->ors_tlimit < 0 || op->ors_tlimit > SLAP_MAX_LIMIT ) {
84 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "invalid time limit" );
88 if ( op->ors_slimit < 0 || op->ors_slimit > SLAP_MAX_LIMIT ) {
89 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "invalid size limit" );
93 switch( op->ors_scope ) {
100 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "invalid scope" );
104 switch( op->ors_deref ) {
111 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "invalid deref" );
115 rs->sr_err = dnPrettyNormal( NULL, &base, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
118 op->o_log_prefix, base.bv_val, 0 );
119 send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
124 base.bv_val, op->ors_scope, op->ors_deref );
126 op->ors_slimit, op->ors_tlimit, op->ors_attrsonly);
129 rs->sr_err = get_filter( op, op->o_ber, &op->ors_filter, &rs->sr_text );
133 send_ldap_disconnect( op, rs );
136 send_ldap_result( op, rs );
140 filter2bv_x( op, op->ors_filter, &op->ors_filterstr );
143 !BER_BVISEMPTY( &op->ors_filterstr ) ? op->ors_filterstr.bv_val : "empty", 0, 0 );
148 if ( ber_scanf( op->o_ber, "{M}}", &op->ors_attrs, &siz, off ) == LBER_ERROR ) {
149 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding attrs error" );
155 op->ors_attrs[i].an_desc = NULL;
156 op->ors_attrs[i].an_oc = NULL;
157 op->ors_attrs[i].an_flags = 0;
158 if ( slap_bv2ad( &op->ors_attrs[i].an_name,
159 &op->ors_attrs[i].an_desc, &dummy ) != LDAP_SUCCESS )
161 slap_bv2undef_ad( &op->ors_attrs[i].an_name,
162 &op->ors_attrs[i].an_desc, &dummy,
167 if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
169 op->o_log_prefix, 0, 0 );
177 Debug( LDAP_DEBUG_ARGS, " %s", op->ors_attrs[i].an_name.bv_val, 0, 0 );
187 sprintf(abuf, "scope=%d deref=%d", op->ors_scope, op->ors_deref);
190 op->o_log_prefix, op->o_req_dn.bv_val, abuf,
191 op->ors_filterstr.bv_val, 0 );
194 alen = op->ors_attrs[i].an_name.bv_len;
200 op->o_log_prefix, abuf, 0, 0, 0 );
208 ptr = lutil_strncopy(ptr, op->ors_attrs[i].an_name.bv_val, alen);
214 op->o_log_prefix, abuf, 0, 0, 0 );
218 op->o_bd = frontendDB;
219 rs->sr_err = frontendDB->be_search( op, rs );
222 if ( !BER_BVISNULL( &op->o_req_dn ) ) {
223 slap_sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
225 if ( !BER_BVISNULL( &op->o_req_ndn ) ) {
226 slap_sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
228 if ( !BER_BVISNULL( &op->ors_filterstr ) ) {
229 op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
231 if ( op->ors_filter != NULL) {
232 filter_free_x( op, op->ors_filter, 1 );
234 if ( op->ors_attrs != NULL ) {
235 op->o_tmpfree( op->ors_attrs, op->o_tmpmemctx );
242 fe_op_search( Operation *op, SlapReply *rs )
244 BackendDB *bd = op->o_bd;
246 if ( op->ors_scope == LDAP_SCOPE_BASE ) {
249 if ( BER_BVISEMPTY( &op->o_req_ndn ) ) {
252 if (op->o_protocol == LDAP_VERSION2 && op->o_conn->c_is_udp) {
257 if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
258 send_ldap_result( op, rs );
262 rs->sr_err = root_dse_info( op->o_conn, &entry, &rs->sr_text );
264 } else if ( bvmatch( &op->o_req_ndn, &frontendDB->be_schemandn ) ) {
266 if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
267 send_ldap_result( op, rs );
275 send_ldap_result( op, rs );
279 rs->sr_err = test_filter( op, entry, op->ors_filter );
286 op->ors_slimit = SLAP_NO_LIMIT;
287 op->ors_tlimit = SLAP_NO_LIMIT;
290 rs->sr_attrs = op->ors_attrs;
293 send_search_entry( op, rs );
300 send_ldap_result( op, rs );
305 if( BER_BVISEMPTY( &op->o_req_ndn ) && !BER_BVISEMPTY( &default_search_nbase ) ) {
306 slap_sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
307 slap_sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
309 ber_dupbv_x( &op->o_req_dn, &default_search_base, op->o_tmpmemctx );
310 ber_dupbv_x( &op->o_req_ndn, &default_search_nbase, op->o_tmpmemctx );
319 op->o_bd = select_backend( &op->o_req_ndn, 1 );
320 if ( op->o_bd == NULL ) {
322 NULL, &op->o_req_dn, op->ors_scope );
326 op->o_bd = bd;
327 send_ldap_result( op, rs );
336 if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
337 send_ldap_result( op, rs );
342 if( backend_check_referrals( op, rs ) != LDAP_SUCCESS ) {
346 if ( SLAP_SHADOW(op->o_bd) && get_dontUseCopy(op) ) {
348 BerVarray defref = op->o_bd->be_update_refs
349 ? op->o_bd->be_update_refs : default_referral;
353 NULL, &op->o_req_dn, op->ors_scope );
356 send_ldap_result( op, rs );
361 send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
365 } else if ( op->o_bd->be_search ) {
366 if ( limits_check( op, rs ) == 0 ) {
368 (op->o_bd->be_search)( op, rs );
373 send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
378 op->o_bd = bd;