{
Attribute *a = NULL, **ap = &a;
-#ifdef SLAPD_SCHEMA_DN
- *ap = slap_operational_subschemaSubentry();
- ap = &(*ap)->a_next;
-#endif
-
/*
* If operational attributes (allegedly) are required,
* and the backend supports specific operational attributes,
* add them to the attribute list
*/
+#ifdef SLAPD_SCHEMA_DN
+ if ( opattrs || ( attrs &&
+ ad_inlist( slap_schema.si_ad_subschemaSubentry, attrs )) ) {
+ *ap = slap_operational_subschemaSubentry();
+ ap = &(*ap)->a_next;
+ }
+#endif
if ( ( opattrs || attrs ) && be && be->be_operational != NULL ) {
( void )be->be_operational( be, conn, op, e, attrs, opattrs, ap );
}