]> git.sur5r.net Git - openldap/blob - servers/slapd/search.c
ITS#2895 store a copy in the entry cache
[openldap] / servers / slapd / search.c
1 /* $OpenLDAP$ */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3  *
4  * Copyright 1998-2003 The OpenLDAP Foundation.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted only as authorized by the OpenLDAP
9  * Public License.
10  *
11  * A copy of this license is available in the file LICENSE in the
12  * top-level directory of the distribution or, alternatively, at
13  * <http://www.OpenLDAP.org/license.html>.
14  */
15 /* Portions Copyright (c) 1995 Regents of the University of Michigan.
16  * All rights reserved.
17  *
18  * Redistribution and use in source and binary forms are permitted
19  * provided that this notice is preserved and that due credit is given
20  * to the University of Michigan at Ann Arbor. The name of the University
21  * may not be used to endorse or promote products derived from this
22  * software without specific prior written permission. This software
23  * is provided ``as is'' without express or implied warranty.
24  */
25
26 #include "portable.h"
27
28 #include <stdio.h>
29
30 #include <ac/string.h>
31 #include <ac/socket.h>
32
33 #include "ldap_pvt.h"
34 #include "lutil.h"
35 #include "slap.h"
36
37 #ifdef LDAP_SLAPI
38 #include "slapi.h"
39 static char **anlist2charray( Operation *op, AttributeName *an );
40 static void initSearchPlugin( Operation *op, char **attrs, int managedsait );
41 static int doPreSearchPluginFNs( Operation *op );
42 static int doSearchRewriteFNs( Operation *op );
43 static void doPostSearchPluginFNs( Operation *op );
44 #endif /* LDAPI_SLAPI */
45
46 int
47 do_search(
48     Operation   *op,    /* info about the op to which we're responding */
49     SlapReply   *rs     /* all the response data we'll send */
50 ) {
51         struct berval base = { 0, NULL };
52         ber_len_t       siz, off, i;
53         int                     manageDSAit;
54         int                     be_manageDSAit;
55 #ifdef LDAP_SLAPI
56         char            **attrs = NULL;
57 #endif
58
59 #ifdef NEW_LOGGING
60         LDAP_LOG( OPERATION, ENTRY, "do_search: conn %d\n", op->o_connid, 0, 0 );
61 #else
62         Debug( LDAP_DEBUG_TRACE, "do_search\n", 0, 0, 0 );
63 #endif
64
65         /*
66          * Parse the search request.  It looks like this:
67          *
68          *      SearchRequest := [APPLICATION 3] SEQUENCE {
69          *              baseObject      DistinguishedName,
70          *              scope           ENUMERATED {
71          *                      baseObject      (0),
72          *                      singleLevel     (1),
73          *                      wholeSubtree (2),
74          *          subordinate (3)  -- OpenLDAP extension
75          *              },
76          *              derefAliases    ENUMERATED {
77          *                      neverDerefaliases       (0),
78          *                      derefInSearching        (1),
79          *                      derefFindingBaseObj     (2),
80          *                      alwaysDerefAliases      (3)
81          *              },
82          *              sizelimit       INTEGER (0 .. 65535),
83          *              timelimit       INTEGER (0 .. 65535),
84          *              attrsOnly       BOOLEAN,
85          *              filter          Filter,
86          *              attributes      SEQUENCE OF AttributeType
87          *      }
88          */
89
90         /* baseObject, scope, derefAliases, sizelimit, timelimit, attrsOnly */
91         if ( ber_scanf( op->o_ber, "{miiiib" /*}*/,
92                 &base, &op->ors_scope, &op->ors_deref, &op->ors_slimit,
93             &op->ors_tlimit, &op->ors_attrsonly ) == LBER_ERROR )
94         {
95                 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding error" );
96                 rs->sr_err = SLAPD_DISCONNECT;
97                 goto return_results;
98         }
99
100         switch( op->ors_scope ) {
101         case LDAP_SCOPE_BASE:
102         case LDAP_SCOPE_ONELEVEL:
103         case LDAP_SCOPE_SUBTREE:
104         case LDAP_SCOPE_SUBORDINATE:
105                 break;
106         default:
107                 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "invalid scope" );
108                 goto return_results;
109         }
110
111         switch( op->ors_deref ) {
112         case LDAP_DEREF_NEVER:
113         case LDAP_DEREF_FINDING:
114         case LDAP_DEREF_SEARCHING:
115         case LDAP_DEREF_ALWAYS:
116                 break;
117         default:
118                 send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "invalid deref" );
119                 goto return_results;
120         }
121
122         rs->sr_err = dnPrettyNormal( NULL, &base, &op->o_req_dn, &op->o_req_ndn, op->o_tmpmemctx );
123         if( rs->sr_err != LDAP_SUCCESS ) {
124 #ifdef NEW_LOGGING
125                 LDAP_LOG( OPERATION, ERR, 
126                         "do_search: conn %d  invalid dn (%s)\n",
127                         op->o_connid, base.bv_val, 0 );
128 #else
129                 Debug( LDAP_DEBUG_ANY,
130                         "do_search: invalid dn (%s)\n", base.bv_val, 0, 0 );
131 #endif
132                 send_ldap_error( op, rs, LDAP_INVALID_DN_SYNTAX, "invalid DN" );
133                 goto return_results;
134         }
135
136 #ifdef NEW_LOGGING
137         LDAP_LOG( OPERATION, ARGS, "SRCH \"%s\" %d %d",
138                 base.bv_val, op->ors_scope, op->ors_deref );
139         LDAP_LOG( OPERATION, ARGS, "    %d %d %d\n",
140                 op->ors_slimit, op->ors_tlimit, op->ors_attrsonly);
141 #else
142         Debug( LDAP_DEBUG_ARGS, "SRCH \"%s\" %d %d",
143                 base.bv_val, op->ors_scope, op->ors_deref );
144         Debug( LDAP_DEBUG_ARGS, "    %d %d %d\n",
145                 op->ors_slimit, op->ors_tlimit, op->ors_attrsonly);
146 #endif
147
148         /* filter - returns a "normalized" version */
149         rs->sr_err = get_filter( op, op->o_ber, &op->ors_filter, &rs->sr_text );
150         if( rs->sr_err != LDAP_SUCCESS ) {
151                 if( rs->sr_err == SLAPD_DISCONNECT ) {
152                         rs->sr_err = LDAP_PROTOCOL_ERROR;
153                         send_ldap_disconnect( op, rs );
154                 } else {
155                         send_ldap_result( op, rs );
156                 }
157                 goto return_results;
158         }
159         filter2bv_x( op, op->ors_filter, &op->ors_filterstr );
160
161 #ifdef NEW_LOGGING
162         LDAP_LOG( OPERATION, ARGS, 
163                 "do_search: conn %d     filter: %s\n", 
164                 op->o_connid, op->ors_filterstr.bv_len ? op->ors_filterstr.bv_val : "empty", 0 );
165 #else
166         Debug( LDAP_DEBUG_ARGS, "    filter: %s\n",
167                 op->ors_filterstr.bv_len ? op->ors_filterstr.bv_val : "empty", 0, 0 );
168 #endif
169
170         /* attributes */
171         siz = sizeof(AttributeName);
172         off = offsetof(AttributeName,an_name);
173         if ( ber_scanf( op->o_ber, "{M}}", &op->ors_attrs, &siz, off ) == LBER_ERROR ) {
174                 send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding attrs error" );
175                 rs->sr_err = SLAPD_DISCONNECT;
176                 goto return_results;
177         }
178         for ( i=0; i<siz; i++ ) {
179                 const char *dummy;      /* ignore msgs from bv2ad */
180                 op->ors_attrs[i].an_desc = NULL;
181                 op->ors_attrs[i].an_oc = NULL;
182                 op->ors_attrs[i].an_oc_exclude = 0;
183                 slap_bv2ad(&op->ors_attrs[i].an_name, &op->ors_attrs[i].an_desc, &dummy);
184         }
185
186         if( get_ctrls( op, rs, 1 ) != LDAP_SUCCESS ) {
187 #ifdef NEW_LOGGING
188                 LDAP_LOG( OPERATION, INFO, 
189                         "do_search: conn %d  get_ctrls failed (%d)\n",
190                         op->o_connid, rs->sr_err, 0 );
191 #else
192                 Debug( LDAP_DEBUG_ANY, "do_search: get_ctrls failed\n", 0, 0, 0 );
193 #endif
194
195                 goto return_results;
196         }
197
198 #ifdef NEW_LOGGING
199         LDAP_LOG( OPERATION, ARGS, 
200                 "do_search: conn %d     attrs:", op->o_connid, 0, 0 );
201 #else
202         Debug( LDAP_DEBUG_ARGS, "    attrs:", 0, 0, 0 );
203 #endif
204
205         if ( siz != 0 ) {
206                 for ( i = 0; i<siz; i++ ) {
207 #ifdef NEW_LOGGING
208                         LDAP_LOG( OPERATION, ARGS, 
209                                 "do_search: %s", op->ors_attrs[i].an_name.bv_val, 0, 0 );
210 #else
211                         Debug( LDAP_DEBUG_ARGS, " %s", op->ors_attrs[i].an_name.bv_val, 0, 0 );
212 #endif
213                 }
214         }
215
216 #ifdef NEW_LOGGING
217         LDAP_LOG( OPERATION, ARGS, "\n" , 0, 0, 0 );
218 #else
219         Debug( LDAP_DEBUG_ARGS, "\n", 0, 0, 0 );
220 #endif
221
222         if ( StatslogTest( LDAP_DEBUG_STATS ) ) {
223                 char abuf[BUFSIZ/2], *ptr = abuf;
224                 int len = 0, alen;
225
226                 sprintf(abuf, "scope=%d deref=%d", op->ors_scope, op->ors_deref);
227                 Statslog( LDAP_DEBUG_STATS,
228                         "conn=%lu op=%lu SRCH base=\"%s\" %s filter=\"%s\"\n",
229                         op->o_connid, op->o_opid, op->o_req_dn.bv_val, abuf,
230                         op->ors_filterstr.bv_val );
231
232                 for ( i = 0; i<siz; i++ ) {
233                         alen = op->ors_attrs[i].an_name.bv_len;
234                         if (alen >= sizeof(abuf)) {
235                                 alen = sizeof(abuf)-1;
236                         }
237                         if (len && (len + 1 + alen >= sizeof(abuf))) {
238                                 Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu SRCH attr=%s\n",
239                                     op->o_connid, op->o_opid, abuf, 0, 0 );
240                                 len = 0;
241                                 ptr = abuf;
242                         }
243                         if (len) {
244                                 *ptr++ = ' ';
245                                 len++;
246                         }
247                         ptr = lutil_strncopy(ptr, op->ors_attrs[i].an_name.bv_val, alen);
248                         len += alen;
249                         *ptr = '\0';
250                 }
251                 if (len) {
252                         Statslog( LDAP_DEBUG_STATS, "conn=%lu op=%lu SRCH attr=%s\n",
253                                 op->o_connid, op->o_opid, abuf, 0, 0 );
254                 }
255         }
256
257         manageDSAit = get_manageDSAit( op );
258
259         /* fake while loop to allow breaking out */
260         while ( op->ors_scope == LDAP_SCOPE_BASE ) {
261                 Entry *entry = NULL;
262
263                 if ( op->o_req_ndn.bv_len == 0 ) {
264 #ifdef LDAP_CONNECTIONLESS
265                         /* Ignore LDAPv2 CLDAP Root DSE queries */
266                         if (op->o_protocol == LDAP_VERSION2 && op->o_conn->c_is_udp) {
267                                 goto return_results;
268                         }
269 #endif
270                         /* check restrictions */
271                         if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
272                                 send_ldap_result( op, rs );
273                                 goto return_results;
274                         }
275
276 #ifdef LDAP_SLAPI
277                         if ( op->o_pb ) {
278                                 attrs = anlist2charray( op, op->ors_attrs );
279                                 initSearchPlugin( op, attrs, manageDSAit );
280                                 rs->sr_err = doPreSearchPluginFNs( op );
281                                 if ( rs->sr_err ) break;
282                                 doSearchRewriteFNs( op );
283                         }
284 #endif /* LDAP_SLAPI */
285                         rs->sr_err = root_dse_info( op->o_conn, &entry, &rs->sr_text );
286
287                 } else if ( bvmatch( &op->o_req_ndn, &global_schemandn ) ) {
288                         /* check restrictions */
289                         if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
290                                 send_ldap_result( op, rs );
291                                 goto return_results;
292                         }
293
294 #ifdef LDAP_SLAPI
295                         if ( op->o_pb ) {
296                                 attrs = anlist2charray( op, op->ors_attrs );
297                                 initSearchPlugin( op, attrs, manageDSAit );
298                                 rs->sr_err = doPreSearchPluginFNs( op );
299                                 if ( rs->sr_err ) break;
300                                 doSearchRewriteFNs( op );
301                         }
302 #endif /* LDAP_SLAPI */
303                         rs->sr_err = schema_info( &entry, &rs->sr_text );
304                 }
305
306                 if( rs->sr_err != LDAP_SUCCESS ) {
307                         send_ldap_result( op, rs );
308 #ifdef LDAP_SLAPI
309                         if ( op->o_pb ) doPostSearchPluginFNs( op );
310 #endif /* LDAP_SLAPI */
311                         goto return_results;
312
313                 } else if ( entry != NULL ) {
314                         rs->sr_err = test_filter( op, entry, op->ors_filter );
315
316                         if( rs->sr_err == LDAP_COMPARE_TRUE ) {
317                                 rs->sr_entry = entry;
318                                 rs->sr_attrs = op->ors_attrs;
319                                 send_search_entry( op, rs );
320                                 rs->sr_entry = NULL;
321                         }
322                         entry_free( entry );
323
324                         rs->sr_err = LDAP_SUCCESS;
325                         send_ldap_result( op, rs );
326 #ifdef LDAP_SLAPI
327                         if ( op->o_pb ) doPostSearchPluginFNs( op );
328 #endif /* LDAP_SLAPI */
329                         goto return_results;
330                 }
331                 break;
332         }
333
334         if( !op->o_req_ndn.bv_len && default_search_nbase.bv_len ) {
335                 sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
336                 sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
337
338                 ber_dupbv_x( &op->o_req_dn, &default_search_base, op->o_tmpmemctx );
339                 ber_dupbv_x( &op->o_req_ndn, &default_search_nbase, op->o_tmpmemctx );
340         }
341
342         /*
343          * We could be serving multiple database backends.  Select the
344          * appropriate one, or send a referral to our "referral server"
345          * if we don't hold it.
346          */
347
348         /* Sync control overrides manageDSAit */
349
350         if ( manageDSAit != SLAP_NO_CONTROL ) {
351                 if ( op->o_sync_mode & SLAP_SYNC_REFRESH ) {
352                         be_manageDSAit = SLAP_NO_CONTROL;
353                 } else {
354                         be_manageDSAit = manageDSAit;
355                 }
356         } else {
357                 be_manageDSAit = manageDSAit;
358         }
359
360         op->o_bd = select_backend( &op->o_req_ndn, be_manageDSAit, 1 );
361         if ( op->o_bd == NULL ) {
362                 rs->sr_ref = referral_rewrite( default_referral,
363                         NULL, &op->o_req_dn, op->ors_scope );
364
365                 if (!rs->sr_ref) rs->sr_ref = default_referral;
366                 rs->sr_err = LDAP_REFERRAL;
367                 send_ldap_result( op, rs );
368
369                 if (rs->sr_ref != default_referral)
370                 ber_bvarray_free( rs->sr_ref );
371                 rs->sr_ref = NULL;
372                 goto return_results;
373         }
374
375         /* check restrictions */
376         if( backend_check_restrictions( op, rs, NULL ) != LDAP_SUCCESS ) {
377                 send_ldap_result( op, rs );
378                 goto return_results;
379         }
380
381         /* check for referrals */
382         if( backend_check_referrals( op, rs ) != LDAP_SUCCESS ) {
383                 goto return_results;
384         }
385
386 #ifdef LDAP_SLAPI
387         if ( op->o_pb ) {
388                 attrs = anlist2charray( op, op->ors_attrs );
389                 initSearchPlugin( op, attrs, manageDSAit );
390                 rs->sr_err = doPreSearchPluginFNs( op );
391                 if ( rs->sr_err != LDAP_SUCCESS ) {
392                         goto return_results;
393                 }
394
395                 doSearchRewriteFNs( op );
396         }
397 #endif /* LDAP_SLAPI */
398
399         /* actually do the search and send the result(s) */
400         if ( op->o_bd->be_search ) {
401                 (op->o_bd->be_search)( op, rs );
402         } else {
403                 send_ldap_error( op, rs, LDAP_UNWILLING_TO_PERFORM,
404                         "operation not supported within namingContext" );
405         }
406
407 #ifdef LDAP_SLAPI
408         if ( op->o_pb ) doPostSearchPluginFNs( op );
409 #endif /* LDAP_SLAPI */
410
411 return_results:;
412
413         if ( ( op->o_sync_mode & SLAP_SYNC_PERSIST ) )
414                 return rs->sr_err;
415
416         if ( ( op->o_sync_slog_size != -1 ) )
417                 return rs->sr_err;
418
419         if( op->o_req_dn.bv_val != NULL) sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
420         if( op->o_req_ndn.bv_val != NULL) sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
421
422         if( op->ors_filterstr.bv_val != NULL) op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
423         if( op->ors_filter != NULL) filter_free_x( op, op->ors_filter );
424         if( op->ors_attrs != NULL ) op->o_tmpfree( op->ors_attrs, op->o_tmpmemctx );
425 #ifdef LDAP_SLAPI
426         if( attrs != NULL) op->o_tmpfree( attrs, op->o_tmpmemctx );
427 #endif /* LDAP_SLAPI */
428
429         return rs->sr_err;
430 }
431
432 #ifdef LDAP_SLAPI
433
434 static char **anlist2charray( Operation *op, AttributeName *an )
435 {
436         char **attrs;
437         int i;
438
439         if ( an != NULL ) {
440                 for ( i = 0; an[i].an_name.bv_val != NULL; i++ )
441                         ;
442                 attrs = (char **)op->o_tmpalloc( (i + 1) * sizeof(char *), op->o_tmpmemctx );
443                 for ( i = 0; an[i].an_name.bv_val != NULL; i++ ) {
444                         attrs[i] = an[i].an_name.bv_val;
445                 }
446                 attrs[i] = NULL;
447         } else {
448                 attrs = NULL;
449         }
450
451         return attrs;
452 }
453
454 static void initSearchPlugin( Operation *op,
455         char **attrs, int managedsait )
456 {
457         slapi_int_pblock_set_operation( op->o_pb, op );
458         slapi_pblock_set( op->o_pb, SLAPI_SEARCH_TARGET, (void *)op->o_req_dn.bv_val );
459         slapi_pblock_set( op->o_pb, SLAPI_SEARCH_SCOPE, (void *)op->ors_scope );
460         slapi_pblock_set( op->o_pb, SLAPI_SEARCH_DEREF, (void *)op->ors_deref );
461         slapi_pblock_set( op->o_pb, SLAPI_SEARCH_SIZELIMIT, (void *)op->ors_slimit );
462         slapi_pblock_set( op->o_pb, SLAPI_SEARCH_TIMELIMIT, (void *)op->ors_tlimit );
463         slapi_pblock_set( op->o_pb, SLAPI_SEARCH_FILTER, (void *)op->ors_filter );
464         slapi_pblock_set( op->o_pb, SLAPI_SEARCH_STRFILTER, (void *)op->ors_filterstr.bv_val );
465         slapi_pblock_set( op->o_pb, SLAPI_SEARCH_ATTRS, (void *)attrs );
466         slapi_pblock_set( op->o_pb, SLAPI_SEARCH_ATTRSONLY, (void *)op->ors_attrsonly );
467         slapi_pblock_set( op->o_pb, SLAPI_MANAGEDSAIT, (void *)managedsait );
468 }
469
470 static int doPreSearchPluginFNs( Operation *op )
471 {
472         int rc;
473
474         rc = doPluginFNs( op->o_bd, SLAPI_PLUGIN_PRE_SEARCH_FN, op->o_pb );
475         if ( rc < 0 ) {
476                 /*
477                  * A preoperation plugin failure will abort the
478                  * entire operation.
479                  */
480 #ifdef NEW_LOGGING
481                 LDAP_LOG( OPERATION, INFO, "doPreSearchPluginFNs: search preoperation plugin "
482                                 "returned %d\n", rc, 0, 0 );
483 #else
484                 Debug(LDAP_DEBUG_TRACE, "doPreSearchPluginFNs: search preoperation plugin "
485                                 "returned %d.\n", rc, 0, 0);
486 #endif
487                 if ( ( slapi_pblock_get( op->o_pb, SLAPI_RESULT_CODE, (void *)&rc ) != 0 ) ||
488                      rc == LDAP_SUCCESS ) {
489                         rc = LDAP_OTHER;
490                 }
491         } else {
492                 rc = LDAP_SUCCESS;
493         }
494
495         return rc;
496 }
497
498 static int doSearchRewriteFNs( Operation *op )
499 {
500         if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_COMPUTE_SEARCH_REWRITER_FN, op->o_pb ) == 0 ) {
501                 int rc;
502
503                 /*
504                  * The plugin can set the SLAPI_SEARCH_FILTER.
505                  * SLAPI_SEARCH_STRFILER is not normative.
506                  */
507                 slapi_pblock_get( op->o_pb, SLAPI_SEARCH_FILTER, (void *)&op->ors_filter );
508                 op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
509                 filter2bv_x( op, op->ors_filter, &op->ors_filterstr );
510
511                 /*
512                  * Also permit other search parameters to be reset. One thing
513                  * this doesn't (yet) deal with is plugins that change a root
514                  * DSE search to a non-root DSE search...
515                  */
516                 slapi_pblock_get( op->o_pb, SLAPI_SEARCH_TARGET, (void **)&op->o_req_dn.bv_val );
517                 op->o_req_dn.bv_len = strlen( op->o_req_dn.bv_val );
518
519                 if( op->o_req_ndn.bv_val != NULL) {
520                         sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );
521                 }
522                 rc = dnNormalize( 0, NULL, NULL, &op->o_req_dn, &op->o_req_ndn,
523                         op->o_tmpmemctx );
524                 if ( rc != LDAP_SUCCESS ) {
525                         return rc;
526                 }
527
528                 slapi_pblock_get( op->o_pb, SLAPI_SEARCH_SCOPE, (void **)&op->ors_scope );
529                 slapi_pblock_get( op->o_pb, SLAPI_SEARCH_DEREF, (void **)&op->ors_deref );
530
531 #ifdef NEW_LOGGING
532                 LDAP_LOG( OPERATION, ARGS, 
533                         "doSearchRewriteFNs: after compute_rewrite_search filter: %s\n", 
534                         op->ors_filterstr.bv_len ? op->ors_filterstr.bv_val : "empty", 0, 0 );
535 #else
536                 Debug( LDAP_DEBUG_ARGS, "    after compute_rewrite_search filter: %s\n",
537                         op->ors_filterstr.bv_len ? op->ors_filterstr.bv_val : "empty", 0, 0 );
538 #endif
539         }
540
541         return LDAP_SUCCESS;
542 }
543
544 static void doPostSearchPluginFNs( Operation *op )
545 {
546         if ( doPluginFNs( op->o_bd, SLAPI_PLUGIN_POST_SEARCH_FN, op->o_pb ) < 0 ) {
547 #ifdef NEW_LOGGING
548                 LDAP_LOG( OPERATION, INFO, "doPostSearchPluginFNs: search postoperation plugins "
549                                 "failed\n", 0, 0, 0 );
550 #else
551                 Debug(LDAP_DEBUG_TRACE, "doPostSearchPluginFNs: search postoperation plugins "
552                                 "failed.\n", 0, 0, 0);
553 #endif
554         }
555 }
556
557 void dummy(void)
558 {
559         /*
560          * XXX slapi_search_internal() was no getting pulled
561          * in; all manner of linker flags failed to link it.
562          * FIXME
563          */
564         slapi_search_internal( NULL, 0, NULL, NULL, NULL, 0 );
565 }
566 #endif /* LDAP_SLAPI */
567