]> git.sur5r.net Git - openldap/commitdiff
only add subschemaSubentry when requested
authorKurt Zeilenga <kurt@openldap.org>
Sat, 10 Aug 2002 00:15:55 +0000 (00:15 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 10 Aug 2002 00:15:55 +0000 (00:15 +0000)
servers/slapd/backend.c

index 3389fceddd787c5ef4cc25a028c3bec3df7a3f3f..133f9fd82e8c52b57c9cd87e4ccb706490135038 100644 (file)
@@ -1105,16 +1105,18 @@ Attribute *backend_operational(
 {
        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 );
        }