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(
741 if( ctrls == NULL ) {
745 if ( be->be_controls == NULL ) {
746 *text = "control unavailable in context";
747 return LDAP_UNAVAILABLE_CRITICAL_EXTENSION;
750 for( ; *ctrls != NULL ; ctrls++ ) {
751 if( (*ctrls)->ldctl_iscritical &&
752 !ldap_charray_inlist( be->be_controls, (*ctrls)->ldctl_oid ) )
754 *text = "control unavailable in context";
755 return LDAP_UNAVAILABLE_CRITICAL_EXTENSION;
763 backend_check_restrictions(
767 struct berval *opdata,
771 slap_mask_t restrictops;
772 slap_mask_t requires;
780 rc = backend_check_controls( be, conn, op, text );
782 if( rc != LDAP_SUCCESS ) {
786 restrictops = be->be_restrictops;
787 requires = be->be_requires;
788 ssf = &be->be_ssf_set;
791 restrictops = global_restrictops;
792 requires = global_requires;
793 ssf = &global_ssf_set;
796 switch( op->o_tag ) {
798 opflag = SLAP_RESTRICT_OP_ADD;
802 opflag = SLAP_RESTRICT_OP_BIND;
805 case LDAP_REQ_COMPARE:
806 opflag = SLAP_RESTRICT_OP_COMPARE;
808 case LDAP_REQ_DELETE:
810 opflag = SLAP_RESTRICT_OP_DELETE;
812 case LDAP_REQ_EXTENDED:
813 opflag = SLAP_RESTRICT_OP_EXTENDED;
816 /* treat unspecified as a modify */
817 opflag = SLAP_RESTRICT_OP_MODIFY;
823 struct berval bv = BER_BVC( LDAP_EXOP_START_TLS );
824 if( bvmatch( opdata, &bv ) ) {
832 struct berval bv = BER_BVC( LDAP_EXOP_X_WHO_AM_I );
833 if( bvmatch( opdata, &bv ) ) {
838 /* treat everything else as a modify */
839 opflag = SLAP_RESTRICT_OP_MODIFY;
843 case LDAP_REQ_MODIFY:
845 opflag = SLAP_RESTRICT_OP_MODIFY;
847 case LDAP_REQ_RENAME:
849 opflag = SLAP_RESTRICT_OP_RENAME;
851 case LDAP_REQ_SEARCH:
852 opflag = SLAP_RESTRICT_OP_SEARCH;
854 case LDAP_REQ_UNBIND:
859 *text = "restrict operations internal error";
864 /* these checks don't apply to StartTLS */
866 if( op->o_transport_ssf < ssf->sss_transport ) {
867 *text = "transport confidentiality required";
868 return LDAP_CONFIDENTIALITY_REQUIRED;
871 if( op->o_tls_ssf < ssf->sss_tls ) {
872 *text = "TLS confidentiality required";
873 return LDAP_CONFIDENTIALITY_REQUIRED;
876 if( op->o_tag != LDAP_REQ_BIND || opdata == NULL ) {
877 /* these checks don't apply to SASL bind */
879 if( op->o_sasl_ssf < ssf->sss_sasl ) {
880 *text = "SASL confidentiality required";
881 return LDAP_CONFIDENTIALITY_REQUIRED;
884 if( op->o_ssf < ssf->sss_ssf ) {
885 *text = "confidentiality required";
886 return LDAP_CONFIDENTIALITY_REQUIRED;
891 if( op->o_transport_ssf < ssf->sss_update_transport ) {
892 *text = "transport update confidentiality required";
893 return LDAP_CONFIDENTIALITY_REQUIRED;
896 if( op->o_tls_ssf < ssf->sss_update_tls ) {
897 *text = "TLS update confidentiality required";
898 return LDAP_CONFIDENTIALITY_REQUIRED;
901 if( op->o_sasl_ssf < ssf->sss_update_sasl ) {
902 *text = "SASL update confidentiality required";
903 return LDAP_CONFIDENTIALITY_REQUIRED;
906 if( op->o_ssf < ssf->sss_update_ssf ) {
907 *text = "update confidentiality required";
908 return LDAP_CONFIDENTIALITY_REQUIRED;
911 if( op->o_ndn.bv_len == 0 ) {
912 *text = "modifications require authentication";
913 return LDAP_STRONG_AUTH_REQUIRED;
919 /* these checks don't apply to Bind, StartTLS, or Unbind */
921 if( requires & SLAP_REQUIRE_STRONG ) {
922 /* should check mechanism */
923 if( ( op->o_transport_ssf < ssf->sss_transport
924 && op->o_authmech.bv_len == 0 ) || op->o_dn.bv_len == 0 )
926 *text = "strong authentication required";
927 return LDAP_STRONG_AUTH_REQUIRED;
931 if( requires & SLAP_REQUIRE_SASL ) {
932 if( op->o_authmech.bv_len == 0 || op->o_dn.bv_len == 0 ) {
933 *text = "SASL authentication required";
934 return LDAP_STRONG_AUTH_REQUIRED;
938 if( requires & SLAP_REQUIRE_AUTHC ) {
939 if( op->o_dn.bv_len == 0 ) {
940 *text = "authentication required";
941 return LDAP_UNWILLING_TO_PERFORM;
945 if( requires & SLAP_REQUIRE_BIND ) {
947 ldap_pvt_thread_mutex_lock( &conn->c_mutex );
948 version = conn->c_protocol;
949 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
952 /* no bind has occurred */
953 *text = "BIND required";
954 return LDAP_OPERATIONS_ERROR;
958 if( requires & SLAP_REQUIRE_LDAP_V3 ) {
959 if( op->o_protocol < LDAP_VERSION3 ) {
960 /* no bind has occurred */
961 *text = "operation restricted to LDAPv3 clients";
962 return LDAP_OPERATIONS_ERROR;
967 if( restrictops & opflag ) {
968 if( restrictops == SLAP_RESTRICT_OP_READS ) {
969 *text = "read operations restricted";
971 *text = "operation restricted";
973 return LDAP_UNWILLING_TO_PERFORM;
979 int backend_check_referrals(
986 int rc = LDAP_SUCCESS;
988 if( be->be_chk_referrals ) {
991 rc = be->be_chk_referrals( be,
992 conn, op, dn, ndn, &text );
994 if( rc != LDAP_SUCCESS && rc != LDAP_REFERRAL ) {
995 send_ldap_result( conn, op, rc,
996 NULL, text, NULL, NULL );
1009 struct berval *gr_ndn,
1010 struct berval *op_ndn,
1011 ObjectClass *group_oc,
1012 AttributeDescription *group_at
1017 if ( op->o_abandon ) return SLAPD_ABANDON;
1019 if ( !dn_match( &target->e_nname, gr_ndn ) ) {
1020 /* we won't attempt to send it to a different backend */
1022 be = select_backend( gr_ndn, 0, 0 );
1025 return LDAP_NO_SUCH_OBJECT;
1029 ldap_pvt_thread_mutex_lock( &conn->c_mutex );
1031 for (g = conn->c_groups; g; g=g->ga_next) {
1032 if (g->ga_be != be || g->ga_oc != group_oc ||
1033 g->ga_at != group_at || g->ga_len != gr_ndn->bv_len)
1035 if (strcmp( g->ga_ndn, gr_ndn->bv_val ) == 0)
1039 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
1045 if( be->be_group ) {
1046 int res = be->be_group( be, conn, op,
1047 target, gr_ndn, op_ndn,
1048 group_oc, group_at );
1050 if ( op->o_tag != LDAP_REQ_BIND && !op->o_do_not_cache ) {
1051 g = ch_malloc(sizeof(GroupAssertion) + gr_ndn->bv_len);
1053 g->ga_oc = group_oc;
1054 g->ga_at = group_at;
1056 g->ga_len = gr_ndn->bv_len;
1057 strcpy(g->ga_ndn, gr_ndn->bv_val);
1058 ldap_pvt_thread_mutex_lock( &conn->c_mutex );
1059 g->ga_next = conn->c_groups;
1061 ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
1067 return LDAP_UNWILLING_TO_PERFORM;
1077 AttributeDescription *entry_at,
1081 if ( target == NULL || !dn_match( &target->e_nname, edn ) ) {
1082 /* we won't attempt to send it to a different backend */
1084 be = select_backend( edn, 0, 0 );
1087 return LDAP_NO_SUCH_OBJECT;
1091 if( be->be_attribute ) {
1092 return be->be_attribute( be, conn, op, target, edn,
1096 return LDAP_UNWILLING_TO_PERFORM;
1099 Attribute *backend_operational(
1104 AttributeName *attrs,
1107 Attribute *a = NULL, **ap = &a;
1110 * If operational attributes (allegedly) are required,
1111 * and the backend supports specific operational attributes,
1112 * add them to the attribute list
1114 #ifdef SLAPD_SCHEMA_DN
1115 if ( opattrs || ( attrs &&
1116 ad_inlist( slap_schema.si_ad_subschemaSubentry, attrs )) ) {
1117 *ap = slap_operational_subschemaSubentry( be );
1118 ap = &(*ap)->a_next;
1121 if ( ( opattrs || attrs ) && be && be->be_operational != NULL ) {
1122 ( void )be->be_operational( be, conn, op, e, attrs, opattrs, ap );