1 /* database.c - deals with database subsystem */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2001-2005 The OpenLDAP Foundation.
6 * Portions Copyright 2001-2003 Pierangelo Masarati.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted only as authorized by the OpenLDAP
13 * A copy of this license is available in file LICENSE in the
14 * top-level directory of the distribution or, alternatively, at
15 * <http://www.OpenLDAP.org/license.html>.
18 * This work was initially developed by Pierangelo Masarati for inclusion
19 * in OpenLDAP Software.
25 #include <ac/string.h>
26 #include <ac/unistd.h>
29 #include "back-monitor.h"
31 #if defined(LDAP_SLAPI)
33 static int monitor_back_add_plugin( monitor_info_t *mi, Backend *be, Entry *e );
34 #endif /* defined(LDAP_SLAPI) */
36 #if defined(SLAPD_BDB)
37 #include "../back-bdb/back-bdb.h"
38 #endif /* defined(SLAPD_BDB) */
39 #if defined(SLAPD_HDB)
40 #include "../back-hdb/back-bdb.h"
41 #endif /* defined(SLAPD_HDB) */
42 #if defined(SLAPD_LDAP)
43 #include "../back-ldap/back-ldap.h"
44 #endif /* defined(SLAPD_LDAP) */
45 #if 0 && defined(SLAPD_LDBM)
46 #include "../back-ldbm/back-ldbm.h"
47 #endif /* defined(SLAPD_LDBM) */
49 /* for PATH_MAX on some systems (e.g. Solaris) */
52 #endif /* HAVE_LIMITS_H */
55 #endif /* ! PATH_MAX */
57 static struct restricted_ops_t {
60 } restricted_ops[] = {
61 { BER_BVC( "add" ), SLAP_RESTRICT_OP_ADD },
62 { BER_BVC( "bind" ), SLAP_RESTRICT_OP_BIND },
63 { BER_BVC( "compare" ), SLAP_RESTRICT_OP_COMPARE },
64 { BER_BVC( "delete" ), SLAP_RESTRICT_OP_DELETE },
65 { BER_BVC( "extended" ), SLAP_RESTRICT_OP_EXTENDED },
66 { BER_BVC( "modify" ), SLAP_RESTRICT_OP_MODIFY },
67 { BER_BVC( "rename" ), SLAP_RESTRICT_OP_RENAME },
68 { BER_BVC( "search" ), SLAP_RESTRICT_OP_SEARCH },
70 }, restricted_exops[] = {
71 { BER_BVC( LDAP_EXOP_START_TLS ), SLAP_RESTRICT_EXOP_START_TLS },
72 { BER_BVC( LDAP_EXOP_MODIFY_PASSWD ), SLAP_RESTRICT_EXOP_MODIFY_PASSWD },
73 { BER_BVC( LDAP_EXOP_X_WHO_AM_I ), SLAP_RESTRICT_EXOP_WHOAMI },
74 { BER_BVC( LDAP_EXOP_X_CANCEL ), SLAP_RESTRICT_EXOP_CANCEL },
79 init_readOnly( monitor_info_t *mi, Entry *e, slap_mask_t restrictops )
81 struct berval *tf = ( ( restrictops & SLAP_RESTRICT_OP_MASK ) == SLAP_RESTRICT_OP_WRITES ) ?
82 (struct berval *)&slap_true_bv : (struct berval *)&slap_false_bv;
84 return attr_merge_one( e, mi->mi_ad_readOnly, tf, NULL );
88 init_restrictedOperation( monitor_info_t *mi, Entry *e, slap_mask_t restrictops )
92 for ( i = 0; restricted_ops[ i ].op.bv_val; i++ ) {
93 if ( restrictops & restricted_ops[ i ].tag ) {
94 rc = attr_merge_one( e, mi->mi_ad_restrictedOperation,
95 &restricted_ops[ i ].op, NULL );
102 for ( i = 0; restricted_exops[ i ].op.bv_val; i++ ) {
103 if ( restrictops & restricted_exops[ i ].tag ) {
104 rc = attr_merge_one( e, mi->mi_ad_restrictedOperation,
105 &restricted_exops[ i ].op, NULL );
116 monitor_subsys_database_init(
122 Entry *e_database, **ep;
125 monitor_subsys_t *ms_backend,
128 assert( be != NULL );
130 mi = ( monitor_info_t * )be->be_private;
132 ms_backend = monitor_back_get_subsys( SLAPD_MONITOR_BACKEND_NAME );
133 if ( ms_backend == NULL ) {
134 Debug( LDAP_DEBUG_ANY,
135 "monitor_subsys_database_init: "
137 "\"" SLAPD_MONITOR_BACKEND_NAME "\" "
143 ms_overlay = monitor_back_get_subsys( SLAPD_MONITOR_OVERLAY_NAME );
144 if ( ms_overlay == NULL ) {
145 Debug( LDAP_DEBUG_ANY,
146 "monitor_subsys_database_init: "
148 "\"" SLAPD_MONITOR_OVERLAY_NAME "\" "
154 if ( monitor_cache_get( mi, &ms->mss_ndn, &e_database ) ) {
155 Debug( LDAP_DEBUG_ANY,
156 "monitor_subsys_database_init: "
157 "unable to get entry \"%s\"\n",
158 ms->mss_ndn.bv_val, 0, 0 );
162 (void)init_readOnly( mi, e_database, frontendDB->be_restrictops );
163 (void)init_restrictedOperation( mi, e_database, frontendDB->be_restrictops );
165 mp = ( monitor_entry_t * )e_database->e_private;
166 mp->mp_children = NULL;
167 ep = &mp->mp_children;
170 LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
171 char buf[ BACKMONITOR_BUFSIZE ];
173 slap_overinfo *oi = NULL;
174 BackendInfo *bi, *bi2;
181 if ( overlay_is_over( be ) ) {
182 oi = (slap_overinfo *)be->bd_info->bi_private;
186 /* Subordinates are not exposed as their own naming context */
187 if ( SLAP_GLUE_SUBORDINATE( be ) ) {
191 snprintf( buf, sizeof( buf ),
192 "dn: cn=Database %d,%s\n"
194 "structuralObjectClass: %s\n"
196 "description: This object contains the type of the database.\n"
199 "modifiersName: %s\n"
200 "createTimestamp: %s\n"
201 "modifyTimestamp: %s\n",
204 mi->mi_oc_monitoredObject->soc_cname.bv_val,
205 mi->mi_oc_monitoredObject->soc_cname.bv_val,
207 mi->mi_ad_monitoredInfo->ad_cname.bv_val,
209 mi->mi_creatorsName.bv_val,
210 mi->mi_creatorsName.bv_val,
211 mi->mi_startTime.bv_val,
212 mi->mi_startTime.bv_val );
214 e = str2entry( buf );
216 Debug( LDAP_DEBUG_ANY,
217 "monitor_subsys_database_init: "
218 "unable to create entry \"cn=Database %d,%s\"\n",
219 i, ms->mss_dn.bv_val, 0 );
223 if ( SLAP_MONITOR(be) ) {
224 attr_merge( e, slap_schema.si_ad_monitorContext,
225 be->be_suffix, be->be_nsuffix );
226 attr_merge( e_database, slap_schema.si_ad_monitorContext,
227 be->be_suffix, be->be_nsuffix );
230 attr_merge( e, slap_schema.si_ad_namingContexts,
231 be->be_suffix, be->be_nsuffix );
232 attr_merge( e_database, slap_schema.si_ad_namingContexts,
233 be->be_suffix, be->be_nsuffix );
236 (void)init_readOnly( mi, e, be->be_restrictops );
237 (void)init_restrictedOperation( mi, e, be->be_restrictops );
240 slap_overinst *on = oi->oi_list,
243 for ( ; on; on = on->on_next ) {
247 for ( on2 = on1; on2 != on; on2 = on2->on_next ) {
248 if ( on2->on_bi.bi_type == on->on_bi.bi_type ) {
257 bv.bv_val = on->on_bi.bi_type;
258 bv.bv_len = strlen( bv.bv_val );
259 attr_merge_normalize_one( e, mi->mi_ad_monitorOverlay,
262 /* find the overlay number, j */
263 for ( on2 = overlay_next( NULL ), j = 0; on2; on2 = overlay_next( on2 ), j++ ) {
264 if ( on2->on_bi.bi_type == on->on_bi.bi_type ) {
270 snprintf( buf, sizeof( buf ),
272 j, ms_overlay->mss_dn.bv_val );
274 bv.bv_len = strlen( buf );
275 attr_merge_normalize_one( e, mi->mi_ad_seeAlso,
280 #if defined(SLAPD_BDB) || defined(SLAPD_HDB)
281 if ( strcmp( bi->bi_type, "bdb" ) == 0
282 || strcmp( bi->bi_type, "hdb" ) == 0 )
285 ber_len_t pathlen = 0, len = 0;
286 char path[ PATH_MAX ] = { '\0' };
289 if ( strcmp( bi->bi_type, "bdb" ) == 0
290 || strcmp( bi->bi_type, "hdb" ) == 0 )
292 struct bdb_info *bdb = (struct bdb_info *) be->be_private;
294 fname = bdb->bi_dbenv_home;
296 } else if ( strcmp( bi->bi_type, "ldbm" ) == 0 ) {
297 struct ldbminfo *ldbm = (struct ldbminfo *) be->be_private;
299 /* FIXME: there's a conflict
300 * between back-bdb.h and back.ldbm.h;
301 * anyway, this code will be moved
302 * to the backends as soon as the
303 * issue with filtering on namingContexts
305 fname = ldbm->li_directory;
309 len = strlen( fname );
310 if ( fname[ 0 ] != '/' ) {
311 /* get full path name */
312 getcwd( path, sizeof( path ) );
313 pathlen = strlen( path );
315 if ( fname[ 0 ] == '.' && fname[ 1 ] == '/' ) {
321 bv.bv_len = STRLENOF( "file://" ) + pathlen
322 + STRLENOF( "/" ) + len;
323 bv.bv_val = ch_malloc( bv.bv_len + STRLENOF( "/" ) + 1 );
324 AC_MEMCPY( bv.bv_val, "file://", STRLENOF( "file://" ) );
326 AC_MEMCPY( &bv.bv_val[ STRLENOF( "file://" ) ],
328 bv.bv_val[ STRLENOF( "file://" ) + pathlen ] = '/';
331 AC_MEMCPY( &bv.bv_val[ STRLENOF( "file://" ) + pathlen ],
333 if ( bv.bv_val[ bv.bv_len - 1 ] != '/' ) {
334 bv.bv_val[ bv.bv_len ] = '/';
337 bv.bv_val[ bv.bv_len ] = '\0';
339 attr_merge_normalize_one( e, slap_schema.si_ad_labeledURI,
342 ch_free( bv.bv_val );
344 #endif /* defined(SLAPD_LDAP) || defined(SLAPD_HDB) */
346 #if defined(SLAPD_LDAP)
347 if ( strcmp( bi->bi_type, "ldap" ) == 0 ) {
348 struct ldapinfo *li =
349 (struct ldapinfo *)be->be_private;
352 ber_str2bv( li->url, 0, 0, &bv );
354 attr_merge_normalize_one( e,
355 slap_schema.si_ad_labeledURI,
358 #endif /* defined(SLAPD_LDAP) */
361 LDAP_STAILQ_FOREACH( bi2, &backendInfo, bi_next ) {
363 if ( bi2->bi_type == bi->bi_type ) {
366 snprintf( buf, sizeof( buf ),
368 j, ms_backend->mss_dn.bv_val );
370 bv.bv_len = strlen( buf );
371 attr_merge_normalize_one( e, mi->mi_ad_seeAlso,
376 /* we must find it! */
379 mp = monitor_entrypriv_create();
383 e->e_private = ( void * )mp;
385 mp->mp_flags = ms->mss_flags
388 if ( monitor_cache_add( mi, e ) ) {
389 Debug( LDAP_DEBUG_ANY,
390 "monitor_subsys_database_init: "
391 "unable to add entry \"cn=Database %d,%s\"\n",
392 i, ms->mss_dn.bv_val, 0 );
396 #if defined(LDAP_SLAPI)
397 monitor_back_add_plugin( mi, be, e );
398 #endif /* defined(LDAP_SLAPI) */
401 Entry **ep_overlay = &mp->mp_children;
402 monitor_entry_t *mp_overlay;
403 slap_overinst *on = oi->oi_list;
406 for ( o = 0; on; o++, on = on->on_next ) {
410 /* find the overlay number, j */
411 for ( on2 = overlay_next( NULL ), j = 0; on2; on2 = overlay_next( on2 ), j++ ) {
412 if ( on2->on_bi.bi_type == on->on_bi.bi_type ) {
418 snprintf( buf, sizeof( buf ),
419 "dn: cn=Overlay %d,cn=Database %d,%s\n"
421 "structuralObjectClass: %s\n"
423 "description: This object contains the type of the overlay.\n"
425 "seeAlso: cn=Overlay %d,%s\n"
427 "modifiersName: %s\n"
428 "createTimestamp: %s\n"
429 "modifyTimestamp: %s\n",
433 mi->mi_oc_monitoredObject->soc_cname.bv_val,
434 mi->mi_oc_monitoredObject->soc_cname.bv_val,
436 mi->mi_ad_monitoredInfo->ad_cname.bv_val,
439 ms_overlay->mss_dn.bv_val,
440 mi->mi_creatorsName.bv_val,
441 mi->mi_creatorsName.bv_val,
442 mi->mi_startTime.bv_val,
443 mi->mi_startTime.bv_val );
445 e_overlay = str2entry( buf );
446 if ( e_overlay == NULL ) {
447 Debug( LDAP_DEBUG_ANY,
448 "monitor_subsys_database_init: "
449 "unable to create entry "
450 "\"cn=Overlay %d,cn=Database %d,%s\"\n",
451 o, i, ms->mss_dn.bv_val );
455 mp_overlay = monitor_entrypriv_create();
456 if ( mp_overlay == NULL ) {
459 e_overlay->e_private = ( void * )mp_overlay;
460 mp_overlay->mp_info = ms;
461 mp_overlay->mp_flags = ms->mss_flags
464 if ( monitor_cache_add( mi, e_overlay ) ) {
465 Debug( LDAP_DEBUG_ANY,
466 "monitor_subsys_database_init: "
467 "unable to add entry "
468 "\"cn=Overlay %d,cn=Database %d,%s\"\n",
469 o, i, ms->mss_dn.bv_val );
473 *ep_overlay = e_overlay;
474 ep_overlay = &mp_overlay->mp_next;
482 monitor_cache_release( mi, e_database );
489 * cur: must not contain the tags corresponding to the values in v
490 * delta: will contain the tags corresponding to the values in v
493 value_mask( BerVarray v, slap_mask_t cur, slap_mask_t *delta )
495 for ( ; !BER_BVISNULL( v ); v++ ) {
496 struct restricted_ops_t *rops;
499 if ( OID_LEADCHAR( v->bv_val[ 0 ] ) ) {
500 rops = restricted_exops;
503 rops = restricted_ops;
506 for ( i = 0; !BER_BVISNULL( &rops[ i ].op ); i++ ) {
507 if ( ber_bvstrcasecmp( v, &rops[ i ].op ) != 0 ) {
511 if ( rops[ i ].tag & *delta ) {
515 if ( rops[ i ].tag & cur ) {
519 cur |= rops[ i ].tag;
520 *delta |= rops[ i ].tag;
525 if ( BER_BVISNULL( &rops[ i ].op ) ) {
526 return LDAP_INVALID_SYNTAX;
534 monitor_subsys_database_modify(
539 monitor_info_t *mi = (monitor_info_t *)op->o_bd->be_private;
541 Attribute *save_attrs, *a;
542 Modifications *modlist = op->oq_modify.rs_modlist;
545 int ro_gotval = 1, i, n;
546 slap_mask_t rp_add = 0, rp_delete = 0, rp_cur;
549 i = sscanf( e->e_nname.bv_val, "cn=database %d,", &n );
551 return LDAP_UNWILLING_TO_PERFORM;
553 if ( n < 0 || n >= nBackendDB )
554 return LDAP_NO_SUCH_OBJECT;
556 LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) {
560 /* do not allow some changes on back-monitor (needs work)... */
561 if ( SLAP_MONITOR( be ) )
562 return LDAP_UNWILLING_TO_PERFORM;
564 rp_cur = be->be_restrictops;
566 save_attrs = e->e_attrs;
567 e->e_attrs = attrs_dup( e->e_attrs );
569 for ( ml=modlist; ml; ml=ml->sml_next ) {
570 Modification *mod = &ml->sml_mod;
572 if ( mod->sm_desc == mi->mi_ad_readOnly ) {
575 if ( mod->sm_values ) {
576 if ( !BER_BVISNULL( &mod->sm_values[ 1 ] ) ) {
577 rc = LDAP_CONSTRAINT_VIOLATION;
581 if ( bvmatch( &slap_true_bv, mod->sm_values )) {
584 } else if ( bvmatch( &slap_false_bv, mod->sm_values )) {
588 rc = LDAP_INVALID_SYNTAX;
593 switch ( mod->sm_op ) {
594 case LDAP_MOD_DELETE:
595 if ( ro_gotval < 1 ) {
596 rc = LDAP_CONSTRAINT_VIOLATION;
601 if ( val == 0 && ( rp_cur & SLAP_RESTRICT_OP_WRITES ) == SLAP_RESTRICT_OP_WRITES ) {
602 rc = LDAP_NO_SUCH_ATTRIBUTE;
606 if ( val == 1 && ( rp_cur & SLAP_RESTRICT_OP_WRITES ) != SLAP_RESTRICT_OP_WRITES ) {
607 rc = LDAP_NO_SUCH_ATTRIBUTE;
613 case LDAP_MOD_REPLACE:
618 if ( ro_gotval > 0 ) {
619 rc = LDAP_CONSTRAINT_VIOLATION;
625 rp_add |= (~rp_cur) & SLAP_RESTRICT_OP_WRITES;
626 rp_cur |= SLAP_RESTRICT_OP_WRITES;
627 rp_delete &= ~SLAP_RESTRICT_OP_WRITES;
629 } else if ( val == 0 ) {
630 rp_delete |= rp_cur & SLAP_RESTRICT_OP_WRITES;
631 rp_cur &= ~SLAP_RESTRICT_OP_WRITES;
632 rp_add &= ~SLAP_RESTRICT_OP_WRITES;
641 } else if ( mod->sm_desc == mi->mi_ad_restrictedOperation ) {
642 slap_mask_t mask = 0;
644 switch ( mod->sm_op ) {
645 case LDAP_MOD_DELETE:
646 if ( mod->sm_values == NULL ) {
652 rc = value_mask( mod->sm_values, ~rp_cur, &mask );
653 if ( rc == LDAP_SUCCESS ) {
658 } else if ( rc == LDAP_OTHER ) {
659 rc = LDAP_NO_SUCH_ATTRIBUTE;
663 case LDAP_MOD_REPLACE:
670 rc = value_mask( mod->sm_values, rp_cur, &mask );
671 if ( rc == LDAP_SUCCESS ) {
676 } else if ( rc == LDAP_OTHER ) {
677 rc = LDAP_TYPE_OR_VALUE_EXISTS;
686 if ( rc != LDAP_SUCCESS ) {
690 } else if ( is_at_operational( mod->sm_desc->ad_type )) {
691 /* accept all operational attributes */
692 attr_delete( &e->e_attrs, mod->sm_desc );
693 rc = attr_merge( e, mod->sm_desc, mod->sm_values,
701 rc = LDAP_UNWILLING_TO_PERFORM;
707 if ( ro_gotval < 1 ) {
708 rc = LDAP_CONSTRAINT_VIOLATION;
712 if ( ( rp_cur & SLAP_RESTRICT_OP_EXTENDED ) && ( rp_cur & SLAP_RESTRICT_EXOP_MASK ) ) {
713 rc = LDAP_CONSTRAINT_VIOLATION;
717 if ( rp_delete & rp_add ) {
722 /* check current value of readOnly */
723 if ( ( rp_cur & SLAP_RESTRICT_OP_WRITES ) == SLAP_RESTRICT_OP_WRITES ) {
724 tf = (struct berval *)&slap_true_bv;
727 tf = (struct berval *)&slap_false_bv;
730 a = attr_find( e->e_attrs, mi->mi_ad_readOnly );
736 if ( !bvmatch( &a->a_vals[ 0 ], tf ) ) {
737 attr_delete( &e->e_attrs, mi->mi_ad_readOnly );
738 rc = attr_merge_one( e, mi->mi_ad_readOnly, tf, NULL );
741 if ( rc == LDAP_SUCCESS ) {
743 if ( rp_delete == be->be_restrictops ) {
744 attr_delete( &e->e_attrs, mi->mi_ad_restrictedOperation );
747 a = attr_find( e->e_attrs, mi->mi_ad_restrictedOperation );
753 for ( i = 0; !BER_BVISNULL( &restricted_ops[ i ].op ); i++ ) {
754 if ( rp_delete & restricted_ops[ i ].tag ) {
757 for ( j = 0; !BER_BVISNULL( &a->a_nvals[ j ] ); j++ ) {
760 if ( !bvmatch( &a->a_nvals[ j ], &restricted_ops[ i ].op ) ) {
764 ch_free( a->a_vals[ j ].bv_val );
765 ch_free( a->a_nvals[ j ].bv_val );
767 for ( k = j + 1; !BER_BVISNULL( &a->a_nvals[ k ] ); k++ ) {
768 a->a_vals[ k - 1 ] = a->a_vals[ k ];
769 a->a_nvals[ k - 1 ] = a->a_nvals[ k ];
772 BER_BVZERO( &a->a_vals[ k - 1 ] );
773 BER_BVZERO( &a->a_nvals[ k - 1 ] );
778 for ( i = 0; !BER_BVISNULL( &restricted_exops[ i ].op ); i++ ) {
779 if ( rp_delete & restricted_exops[ i ].tag ) {
782 for ( j = 0; !BER_BVISNULL( &a->a_nvals[ j ] ); j++ ) {
785 if ( !bvmatch( &a->a_nvals[ j ], &restricted_exops[ i ].op ) ) {
789 ch_free( a->a_vals[ j ].bv_val );
790 ch_free( a->a_nvals[ j ].bv_val );
792 for ( k = j + 1; !BER_BVISNULL( &a->a_nvals[ k ] ); k++ ) {
793 a->a_vals[ k - 1 ] = a->a_vals[ k ];
794 a->a_nvals[ k - 1 ] = a->a_nvals[ k ];
797 BER_BVZERO( &a->a_vals[ k - 1 ] );
798 BER_BVZERO( &a->a_nvals[ k - 1 ] );
806 for ( i = 0; !BER_BVISNULL( &restricted_ops[ i ].op ); i++ ) {
807 if ( rp_add & restricted_ops[ i ].tag ) {
808 attr_merge_one( e, mi->mi_ad_restrictedOperation,
809 &restricted_ops[ i ].op, NULL );
813 for ( i = 0; !BER_BVISNULL( &restricted_exops[ i ].op ); i++ ) {
814 if ( rp_add & restricted_exops[ i ].tag ) {
815 attr_merge_one( e, mi->mi_ad_restrictedOperation,
816 &restricted_exops[ i ].op, NULL );
822 be->be_restrictops = rp_cur;
825 if ( rc == LDAP_SUCCESS ) {
826 attrs_free( save_attrs );
829 Attribute *tmp = e->e_attrs;
830 e->e_attrs = save_attrs;
836 #if defined(LDAP_SLAPI)
838 monitor_back_add_plugin( monitor_info_t *mi, Backend *be, Entry *e_database )
840 Slapi_PBlock *pCurrentPB;
841 int i, rc = LDAP_SUCCESS;
843 if ( slapi_int_pblock_get_first( be, &pCurrentPB ) != LDAP_SUCCESS ) {
845 * LDAP_OTHER is returned if no plugins are installed
853 Slapi_PluginDesc *srchdesc;
854 char buf[ BACKMONITOR_BUFSIZE ];
857 rc = slapi_pblock_get( pCurrentPB, SLAPI_PLUGIN_DESCRIPTION,
859 if ( rc != LDAP_SUCCESS ) {
863 snprintf( buf, sizeof(buf),
864 "plugin %d name: %s; "
870 srchdesc->spd_vendor,
871 srchdesc->spd_version,
872 srchdesc->spd_description );
875 bv.bv_len = strlen( buf );
876 attr_merge_normalize_one( e_database,
877 mi->mi_ad_monitoredInfo, &bv, NULL );
881 } while ( ( slapi_int_pblock_get_next( &pCurrentPB ) == LDAP_SUCCESS )
882 && ( pCurrentPB != NULL ) );
887 #endif /* defined(LDAP_SLAPI) */