3 * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6 /* backend.c - routines for dealing with back-end databases */
13 #include <ac/string.h>
14 #include <ac/socket.h>
23 * If a module is configured as dynamic, its header should not
24 * get included into slapd. While this is a general rule and does
25 * not have much of an effect in UNIX, this rule should be adhered
26 * to for Windows, where dynamic object code should not be implicitly
27 * imported into slapd without appropriate __declspec(dllimport) directives.
30 #if defined(SLAPD_BDB) && !defined(SLAPD_BDB_DYNAMIC)
31 #include "back-bdb/external.h"
33 #if defined(SLAPD_DNSSRV) && !defined(SLAPD_DNSSRV_DYNAMIC)
34 #include "back-dnssrv/external.h"
36 #if defined(SLAPD_LDAP) && !defined(SLAPD_LDAP_DYNAMIC)
37 #include "back-ldap/external.h"
39 #if defined(SLAPD_LDBM) && !defined(SLAPD_LDBM_DYNAMIC)
40 #include "back-ldbm/external.h"
42 #if defined(SLAPD_META) && !defined(SLAPD_META_DYNAMIC)
43 #include "back-meta/external.h"
45 #if defined(SLAPD_MONITOR) && !defined(SLAPD_MONITOR_DYNAMIC)
46 #include "back-monitor/external.h"
48 #if defined(SLAPD_NULL) && !defined(SLAPD_NULL_DYNAMIC)
49 #include "back-null/external.h"
51 #if defined(SLAPD_PASSWD) && !defined(SLAPD_PASSWD_DYNAMIC)
52 #include "back-passwd/external.h"
54 #if defined(SLAPD_PERL) && !defined(SLAPD_PERL_DYNAMIC)
55 #include "back-perl/external.h"
57 #if defined(SLAPD_SHELL) && !defined(SLAPD_SHELL_DYNAMIC)
58 #include "back-shell/external.h"
60 #if defined(SLAPD_TCL) && !defined(SLAPD_TCL_DYNAMIC)
61 #include "back-tcl/external.h"
63 #if defined(SLAPD_SQL) && !defined(SLAPD_SQL_DYNAMIC)
64 #include "back-sql/external.h"
66 #if defined(SLAPD_PRIVATE) && !defined(SLAPD_PRIVATE_DYNAMIC)
67 #include "private/external.h"
70 static BackendInfo binfo[] = {
71 #if defined(SLAPD_BDB) && !defined(SLAPD_BDB_DYNAMIC)
72 {"bdb", bdb_initialize},
74 #if defined(SLAPD_DNSSRV) && !defined(SLAPD_DNSSRV_DYNAMIC)
75 {"dnssrv", dnssrv_back_initialize},
77 #if defined(SLAPD_LDAP) && !defined(SLAPD_LDAP_DYNAMIC)
78 {"ldap", ldap_back_initialize},
80 #if defined(SLAPD_LDBM) && !defined(SLAPD_LDBM_DYNAMIC)
81 {"ldbm", ldbm_back_initialize},
83 #if defined(SLAPD_META) && !defined(SLAPD_META_DYNAMIC)
84 {"meta", meta_back_initialize},
86 #if defined(SLAPD_MONITOR) && !defined(SLAPD_MONITOR_DYNAMIC)
87 {"monitor", monitor_back_initialize},
89 #if defined(SLAPD_NULL) && !defined(SLAPD_NULL_DYNAMIC)
90 {"null", null_back_initialize},
92 #if defined(SLAPD_PASSWD) && !defined(SLAPD_PASSWD_DYNAMIC)
93 {"passwd", passwd_back_initialize},
95 #if defined(SLAPD_PERL) && !defined(SLAPD_PERL_DYNAMIC)
96 {"perl", perl_back_initialize},
98 #if defined(SLAPD_SHELL) && !defined(SLAPD_SHELL_DYNAMIC)
99 {"shell", shell_back_initialize},
101 #if defined(SLAPD_TCL) && !defined(SLAPD_TCL_DYNAMIC)
102 {"tcl", tcl_back_initialize},
104 #if defined(SLAPD_SQL) && !defined(SLAPD_SQL_DYNAMIC)
105 {"sql", sql_back_initialize},
107 /* for any private backend */
108 #if defined(SLAPD_PRIVATE) && !defined(SLAPD_PRIVATE_DYNAMIC)
109 {"private", private_back_initialize},
114 int nBackendInfo = 0;
115 BackendInfo *backendInfo = NULL;
118 BackendDB *backendDB = NULL;
120 int backend_init(void)
124 if((nBackendInfo != 0) || (backendInfo != NULL)) {
125 /* already initialized */
127 LDAP_LOG( BACKEND, ERR,
128 "backend_init: backend already initialized\n", 0, 0, 0 );
130 Debug( LDAP_DEBUG_ANY,
131 "backend_init: already initialized.\n", 0, 0, 0 );
137 binfo[nBackendInfo].bi_type != NULL;
140 rc = binfo[nBackendInfo].bi_init( &binfo[nBackendInfo] );
144 LDAP_LOG( BACKEND, INFO,
145 "backend_init: initialized for type \"%s\"\n",
146 binfo[nBackendInfo].bi_type, 0, 0 );
148 Debug( LDAP_DEBUG_ANY,
149 "backend_init: initialized for type \"%s\"\n",
150 binfo[nBackendInfo].bi_type, 0, 0 );
152 /* destroy those we've already inited */
157 if ( binfo[nBackendInfo].bi_destroy ) {
158 binfo[nBackendInfo].bi_destroy(
159 &binfo[nBackendInfo] );
166 if ( nBackendInfo > 0) {
176 LDAP_LOG( BACKEND, ERR, "backend_init: failed\n", 0, 0, 0 );
178 Debug( LDAP_DEBUG_ANY,
179 "backend_init: failed\n",
184 #endif /* SLAPD_MODULES */
187 int backend_add(BackendInfo *aBackendInfo)
191 if ((rc = aBackendInfo->bi_init(aBackendInfo)) != 0) {
193 LDAP_LOG( BACKEND, ERR,
194 "backend_add: initialization for type \"%s\" failed\n",
195 aBackendInfo->bi_type, 0, 0 );
197 Debug( LDAP_DEBUG_ANY,
198 "backend_add: initialization for type \"%s\" failed\n",
199 aBackendInfo->bi_type, 0, 0 );
204 /* now add the backend type to the Backend Info List */
206 BackendInfo *newBackendInfo = 0;
208 /* if backendInfo == binfo no deallocation of old backendInfo */
209 if (backendInfo == binfo) {
210 newBackendInfo = ch_calloc(nBackendInfo + 1, sizeof(BackendInfo));
211 AC_MEMCPY(newBackendInfo, backendInfo, sizeof(BackendInfo) *
214 newBackendInfo = ch_realloc(backendInfo, sizeof(BackendInfo) *
217 AC_MEMCPY(&newBackendInfo[nBackendInfo], aBackendInfo,
218 sizeof(BackendInfo));
219 backendInfo = newBackendInfo;
226 int backend_startup(Backend *be)
231 if( ! ( nBackendDB > 0 ) ) {
234 LDAP_LOG( BACKEND, INFO,
235 "backend_startup: %d databases to startup. \n", nBackendDB, 0, 0 );
237 Debug( LDAP_DEBUG_ANY,
238 "backend_startup: %d databases to startup.\n",
245 /* startup a specific backend database */
247 LDAP_LOG( BACKEND, DETAIL1, "backend_startup: starting \"%s\"\n",
248 be->be_suffix[0].bv_val, 0, 0 );
250 Debug( LDAP_DEBUG_TRACE,
251 "backend_startup: starting \"%s\"\n",
252 be->be_suffix[0].bv_val, 0, 0 );
255 if ( be->bd_info->bi_open ) {
256 rc = be->bd_info->bi_open( be->bd_info );
259 LDAP_LOG( BACKEND, CRIT, "backend_startup: bi_open failed!\n", 0, 0, 0 );
261 Debug( LDAP_DEBUG_ANY,
262 "backend_startup: bi_open failed!\n",
270 if ( be->bd_info->bi_db_open ) {
271 rc = be->bd_info->bi_db_open( be );
274 LDAP_LOG( BACKEND, CRIT,
275 "backend_startup: bi_db_open failed! (%d)\n", rc, 0, 0 );
277 Debug( LDAP_DEBUG_ANY,
278 "backend_startup: bi_db_open failed! (%d)\n",
288 /* open each backend type */
289 for( i = 0; i < nBackendInfo; i++ ) {
290 if( backendInfo[i].bi_nDB == 0) {
291 /* no database of this type, don't open */
295 if( backendInfo[i].bi_open ) {
296 rc = backendInfo[i].bi_open(
300 LDAP_LOG( BACKEND, CRIT,
301 "backend_startup: bi_open %d failed!\n", i, 0, 0 );
303 Debug( LDAP_DEBUG_ANY,
304 "backend_startup: bi_open %d failed!\n",
312 /* open each backend database */
313 for( i = 0; i < nBackendDB; i++ ) {
314 /* append global access controls */
315 acl_append( &backendDB[i].be_acl, global_acl );
317 if ( backendDB[i].bd_info->bi_db_open ) {
318 rc = backendDB[i].bd_info->bi_db_open(
322 LDAP_LOG( BACKEND, CRIT,
323 "backend_startup: bi_db_open(%d) failed! (%d)\n", i, rc, 0 );
325 Debug( LDAP_DEBUG_ANY,
326 "backend_startup: bi_db_open(%d) failed! (%d)\n",
337 int backend_num( Backend *be )
341 if( be == NULL ) return -1;
343 for( i = 0; i < nBackendDB; i++ ) {
344 if( be == &backendDB[i] ) return i;
349 int backend_shutdown( Backend *be )
355 /* shutdown a specific backend database */
357 if ( be->bd_info->bi_nDB == 0 ) {
358 /* no database of this type, we never opened it */
362 if ( be->bd_info->bi_db_close ) {
363 be->bd_info->bi_db_close( be );
366 if( be->bd_info->bi_close ) {
367 be->bd_info->bi_close( be->bd_info );
373 /* close each backend database */
374 for( i = 0; i < nBackendDB; i++ ) {
375 if ( backendDB[i].bd_info->bi_db_close ) {
376 backendDB[i].bd_info->bi_db_close(
382 LDAP_LOG( BACKEND, NOTICE,
383 "backend_shutdown: bi_close %s failed!\n",
384 backendDB[i].be_type, 0, 0 );
386 Debug( LDAP_DEBUG_ANY,
387 "backend_close: bi_close %s failed!\n",
388 backendDB[i].be_type, 0, 0 );
393 /* close each backend type */
394 for( i = 0; i < nBackendInfo; i++ ) {
395 if( backendInfo[i].bi_nDB == 0 ) {
396 /* no database of this type */
400 if( backendInfo[i].bi_close ) {
401 backendInfo[i].bi_close(
409 int backend_destroy(void)
414 /* destroy each backend database */
415 for( i = 0, bd = backendDB; i < nBackendDB; i++, bd++ ) {
416 if ( bd->bd_info->bi_db_destroy ) {
417 bd->bd_info->bi_db_destroy( bd );
419 ber_bvarray_free( bd->be_suffix );
420 ber_bvarray_free( bd->be_nsuffix );
421 if ( bd->be_rootdn.bv_val ) free( bd->be_rootdn.bv_val );
422 if ( bd->be_rootndn.bv_val ) free( bd->be_rootndn.bv_val );
423 if ( bd->be_rootpw.bv_val ) free( bd->be_rootpw.bv_val );
424 acl_destroy( bd->be_acl, global_acl );
428 /* destroy each backend type */
429 for( i = 0; i < nBackendInfo; i++ ) {
430 if( backendInfo[i].bi_destroy ) {
431 backendInfo[i].bi_destroy(
437 if (backendInfo != binfo) {
440 #endif /* SLAPD_MODULES */
448 BackendInfo* backend_info(const char *type)
452 /* search for the backend type */
453 for( i = 0; i < nBackendInfo; i++ ) {
454 if( strcasecmp(backendInfo[i].bi_type, type) == 0 ) {
455 return &backendInfo[i];
469 BackendInfo *bi = backend_info(type);
473 fprintf( stderr, "Unrecognized database type (%s)\n", type );
477 backendDB = (BackendDB *) ch_realloc(
479 (nBackendDB + 1) * sizeof(Backend) );
481 memset( &backendDB[nbackends], '\0', sizeof(Backend) );
483 be = &backends[nbackends++];
486 be->be_def_limit = deflimit;
487 be->be_dfltaccess = global_default_access;
489 be->be_restrictops = global_restrictops;
490 be->be_requires = global_requires;
491 be->be_ssf_set = global_ssf_set;
493 /* assign a default depth limit for alias deref */
494 be->be_max_deref_depth = SLAPD_DEFAULT_MAXDEREFDEPTH;
497 rc = bi->bi_db_init( be );
501 fprintf( stderr, "database init failed (%s)\n", type );
515 for ( i = 0; i < nbackends; i++ ) {
516 if ( backends[i].bd_info->bi_db_close ) {
517 (*backends[i].bd_info->bi_db_close)( &backends[i] );
529 ber_len_t len, dnlen = dn->bv_len;
532 for ( i = 0; i < nbackends; i++ ) {
533 for ( j = 0; backends[i].be_nsuffix != NULL &&
534 backends[i].be_nsuffix[j].bv_val != NULL; j++ )
536 if (( backends[i].be_flags & SLAP_BFLAG_GLUE_SUBORDINATE )
542 len = backends[i].be_nsuffix[j].bv_len;
545 /* suffix is longer than DN */
550 * input DN is normalized, so the separator check
551 * need not look at escaping
553 if ( len && len < dnlen &&
554 !DN_SEPARATOR( dn->bv_val[(dnlen-len)-1] ))
559 if ( strcmp( backends[i].be_nsuffix[j].bv_val,
560 &dn->bv_val[dnlen-len] ) == 0 )
565 if( manageDSAit && len == dnlen ) {
582 struct berval *bvsuffix
587 for ( i = 0; be->be_nsuffix != NULL && be->be_nsuffix[i].bv_val != NULL; i++ ) {
588 if ( bvmatch( &be->be_nsuffix[i], bvsuffix ) ) {
597 be_isroot( Backend *be, struct berval *ndn )
599 if ( !ndn->bv_len ) {
603 if ( !be->be_rootndn.bv_len ) {
607 return dn_match( &be->be_rootndn, ndn );
611 be_isupdate( Backend *be, struct berval *ndn )
613 if ( !ndn->bv_len ) {
617 if ( !be->be_update_ndn.bv_len ) {
621 return dn_match( &be->be_update_ndn, ndn );
625 be_root_dn( Backend *be )
627 return &be->be_rootdn;
631 be_isroot_pw( Backend *be,
634 struct berval *cred )
638 if ( ! be_isroot( be, ndn ) ) {
642 if( be->be_rootpw.bv_len == 0 ) {
646 #if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
647 ldap_pvt_thread_mutex_lock( &passwd_mutex );
649 lutil_passwd_sasl_conn = conn->c_sasl_context;
653 result = lutil_passwd( &be->be_rootpw, cred, NULL );
655 #if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
657 lutil_passwd_sasl_conn = NULL;
659 ldap_pvt_thread_mutex_unlock( &passwd_mutex );
673 if ( be->be_release ) {
674 /* free and release entry from backend */
675 return be->be_release( be, conn, op, e, rw );
691 for ( i = 0; i < nbackends; i++ ) {
692 if ( backends[i].be_unbind ) {
693 (*backends[i].be_unbind)( &backends[i], conn, op );
701 backend_connection_init(
707 for ( i = 0; i < nbackends; i++ ) {
708 if ( backends[i].be_connection_init ) {
709 (*backends[i].be_connection_init)( &backends[i], conn);
717 backend_connection_destroy(
723 for ( i = 0; i < nbackends; i++ ) {
724 if ( backends[i].be_connection_destroy ) {
725 (*backends[i].be_connection_destroy)( &backends[i], conn);
733 backend_check_controls(
739 LDAPControl **ctrls = op->o_ctrls;
741 if( ctrls == NULL ) return LDAP_SUCCESS;
743 for( ; *ctrls != NULL ; ctrls++ ) {
744 if( (*ctrls)->ldctl_iscritical &&
745 !ldap_charray_inlist( be->be_controls, (*ctrls)->ldctl_oid ) )
747 *text = "control unavailable in context";
748 return LDAP_UNAVAILABLE_CRITICAL_EXTENSION;
756 backend_check_restrictions(
760 struct berval *opdata,
764 slap_mask_t restrictops;
765 slap_mask_t requires;
773 rc = backend_check_controls( be, conn, op, text );
775 if( rc != LDAP_SUCCESS ) {
779 restrictops = be->be_restrictops;
780 requires = be->be_requires;
781 ssf = &be->be_ssf_set;
784 restrictops = global_restrictops;
785 requires = global_requires;
786 ssf = &global_ssf_set;
789 switch( op->o_tag ) {
791 opflag = SLAP_RESTRICT_OP_ADD;
795 opflag = SLAP_RESTRICT_OP_BIND;
798 case LDAP_REQ_COMPARE:
799 opflag = SLAP_RESTRICT_OP_COMPARE;
801 case LDAP_REQ_DELETE:
803 opflag = SLAP_RESTRICT_OP_DELETE;
805 case LDAP_REQ_EXTENDED:
806 opflag = SLAP_RESTRICT_OP_EXTENDED;
809 /* treat unspecified as a modify */
810 opflag = SLAP_RESTRICT_OP_MODIFY;
816 struct berval bv = BER_BVC( LDAP_EXOP_START_TLS );
817 if( bvmatch( opdata, &bv ) ) {
825 struct berval bv = BER_BVC( LDAP_EXOP_X_WHO_AM_I );
826 if( bvmatch( opdata, &bv ) ) {
831 /* treat everything else as a modify */
832 opflag = SLAP_RESTRICT_OP_MODIFY;
836 case LDAP_REQ_MODIFY:
838 opflag = SLAP_RESTRICT_OP_MODIFY;
840 case LDAP_REQ_RENAME:
842 opflag = SLAP_RESTRICT_OP_RENAME;
844 case LDAP_REQ_SEARCH:
845 opflag = SLAP_RESTRICT_OP_SEARCH;
847 case LDAP_REQ_UNBIND:
852 *text = "restrict operations internal error";
857 /* these checks don't apply to StartTLS */
859 if( op->o_transport_ssf < ssf->sss_transport ) {
860 *text = "transport confidentiality required";
861 return LDAP_CONFIDENTIALITY_REQUIRED;
864 if( op->o_tls_ssf < ssf->sss_tls ) {
865 *text = "TLS confidentiality required";
866 return LDAP_CONFIDENTIALITY_REQUIRED;
869 if( op->o_tag != LDAP_REQ_BIND || opdata == NULL ) {
870 /* these checks don't apply to SASL bind */
872 if( op->o_sasl_ssf < ssf->sss_sasl ) {
873 *text = "SASL confidentiality required";
874 return LDAP_CONFIDENTIALITY_REQUIRED;
877 if( op->o_ssf < ssf->sss_ssf ) {
878 *text = "confidentiality required";
879 return LDAP_CONFIDENTIALITY_REQUIRED;
884 if( op->o_transport_ssf < ssf->sss_update_transport ) {
885 *text = "transport update confidentiality required";
886 return LDAP_CONFIDENTIALITY_REQUIRED;
889 if( op->o_tls_ssf < ssf->sss_update_tls ) {
890 *text = "TLS update confidentiality required";
891 return LDAP_CONFIDENTIALITY_REQUIRED;
894 if( op->o_sasl_ssf < ssf->sss_update_sasl ) {
895 *text = "SASL update confidentiality required";
896 return LDAP_CONFIDENTIALITY_REQUIRED;
899 if( op->o_ssf < ssf->sss_update_ssf ) {
900 *text = "update confidentiality required";
901 return LDAP_CONFIDENTIALITY_REQUIRED;
904 if( op->o_ndn.bv_len == 0 ) {
905 *text = "modifications require authentication";
906 return LDAP_STRONG_AUTH_REQUIRED;
912 /* these checks don't apply to Bind, StartTLS, or Unbind */
914 if( requires & SLAP_REQUIRE_STRONG ) {
915 /* should check mechanism */
916 if( ( op->o_transport_ssf < ssf->sss_transport
917 && op->o_authmech.bv_len == 0 ) || op->o_dn.bv_len == 0 )
919 *text = "strong authentication required";
920 return LDAP_STRONG_AUTH_REQUIRED;
924 if( requires & SLAP_REQUIRE_SASL ) {
925 if( op->o_authmech.bv_len == 0 || op->o_dn.bv_len == 0 ) {
926 *text = "SASL authentication required";
927 return LDAP_STRONG_AUTH_REQUIRED;
931 if( requires & SLAP_REQUIRE_AUTHC ) {
932 if( op->o_dn.bv_len == 0 ) {
933 *text = "authentication required";
934 return LDAP_UNWILLING_TO_PERFORM;
938 if( requires & SLAP_REQUIRE_BIND ) {
940 ldap_pvt_thread_mutex_lock( &conn->c_mutex );
941 version = conn->c_protocol;
942 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
945 /* no bind has occurred */
946 *text = "BIND required";
947 return LDAP_OPERATIONS_ERROR;
951 if( requires & SLAP_REQUIRE_LDAP_V3 ) {
952 if( op->o_protocol < LDAP_VERSION3 ) {
953 /* no bind has occurred */
954 *text = "operation restricted to LDAPv3 clients";
955 return LDAP_OPERATIONS_ERROR;
960 if( restrictops & opflag ) {
961 if( restrictops == SLAP_RESTRICT_OP_READS ) {
962 *text = "read operations restricted";
964 *text = "operation restricted";
966 return LDAP_UNWILLING_TO_PERFORM;
972 int backend_check_referrals(
979 int rc = LDAP_SUCCESS;
981 if( be->be_chk_referrals ) {
984 rc = be->be_chk_referrals( be,
985 conn, op, dn, ndn, &text );
987 if( rc != LDAP_SUCCESS && rc != LDAP_REFERRAL ) {
988 send_ldap_result( conn, op, rc,
989 NULL, text, NULL, NULL );
1002 struct berval *gr_ndn,
1003 struct berval *op_ndn,
1004 ObjectClass *group_oc,
1005 AttributeDescription *group_at
1010 if ( op->o_abandon ) return SLAPD_ABANDON;
1012 if ( !dn_match( &target->e_nname, gr_ndn ) ) {
1013 /* we won't attempt to send it to a different backend */
1015 be = select_backend( gr_ndn, 0, 0 );
1018 return LDAP_NO_SUCH_OBJECT;
1022 ldap_pvt_thread_mutex_lock( &conn->c_mutex );
1024 for (g = conn->c_groups; g; g=g->ga_next) {
1025 if (g->ga_be != be || g->ga_oc != group_oc ||
1026 g->ga_at != group_at || g->ga_len != gr_ndn->bv_len)
1028 if (strcmp( g->ga_ndn, gr_ndn->bv_val ) == 0)
1032 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
1038 if( be->be_group ) {
1039 int res = be->be_group( be, conn, op,
1040 target, gr_ndn, op_ndn,
1041 group_oc, group_at );
1043 if ( op->o_tag != LDAP_REQ_BIND && !op->o_do_not_cache ) {
1044 g = ch_malloc(sizeof(GroupAssertion) + gr_ndn->bv_len);
1046 g->ga_oc = group_oc;
1047 g->ga_at = group_at;
1049 g->ga_len = gr_ndn->bv_len;
1050 strcpy(g->ga_ndn, gr_ndn->bv_val);
1051 ldap_pvt_thread_mutex_lock( &conn->c_mutex );
1052 g->ga_next = conn->c_groups;
1054 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
1060 return LDAP_UNWILLING_TO_PERFORM;
1070 AttributeDescription *entry_at,
1074 if ( target == NULL || !dn_match( &target->e_nname, edn ) ) {
1075 /* we won't attempt to send it to a different backend */
1077 be = select_backend( edn, 0, 0 );
1080 return LDAP_NO_SUCH_OBJECT;
1084 if( be->be_attribute ) {
1085 return be->be_attribute( be, conn, op, target, edn,
1089 return LDAP_UNWILLING_TO_PERFORM;
1092 Attribute *backend_operational(
1097 AttributeName *attrs,
1100 Attribute *a = NULL, **ap = &a;
1103 * If operational attributes (allegedly) are required,
1104 * and the backend supports specific operational attributes,
1105 * add them to the attribute list
1107 #ifdef SLAPD_SCHEMA_DN
1108 if ( opattrs || ( attrs &&
1109 ad_inlist( slap_schema.si_ad_subschemaSubentry, attrs )) ) {
1110 *ap = slap_operational_subschemaSubentry( be );
1111 ap = &(*ap)->a_next;
1114 if ( ( opattrs || attrs ) && be && be->be_operational != NULL ) {
1115 ( void )be->be_operational( be, conn, op, e, attrs, opattrs, ap );