]> git.sur5r.net Git - openldap/commitdiff
expose subordinate databases; add a link to the superior DN
authorPierangelo Masarati <ando@openldap.org>
Thu, 13 Aug 2009 20:58:20 +0000 (20:58 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 13 Aug 2009 20:58:20 +0000 (20:58 +0000)
servers/slapd/back-monitor/back-monitor.h
servers/slapd/back-monitor/database.c
servers/slapd/back-monitor/init.c

index 11f8019d84ec3b145c2e466361a81120e485634a..15debe0f2f2909f4965e03e4bb9fa8ecad6414eb 100644 (file)
@@ -130,6 +130,7 @@ typedef struct monitor_info_t {
        AttributeDescription    *mi_ad_monitorIsShadow;
        AttributeDescription    *mi_ad_monitorUpdateRef;
        AttributeDescription    *mi_ad_monitorRuntimeConfig;
+       AttributeDescription    *mi_ad_monitorSuperiorDN;
 
        /*
         * Generic description attribute
index eb75a340f08eff109d0ec119c264fed33f0c14e2..8de1d833ee7d306d49f58419dbd9fc32d4898dcf 100644 (file)
@@ -126,11 +126,6 @@ monitor_subsys_database_init_one(
                bi = oi->oi_orig;
        }
 
-       /* Subordinates are not exposed as their own naming context */
-       if ( SLAP_GLUE_SUBORDINATE( be ) ) {
-               return 0;
-       }
-
        e = monitor_entry_stub( &ms->mss_dn, &ms->mss_ndn, rdn,
                mi->mi_oc_monitoredObject, mi, NULL, NULL );
 
@@ -166,6 +161,21 @@ monitor_subsys_database_init_one(
                        attr_merge( e_database, slap_schema.si_ad_namingContexts,
                                be->be_suffix, NULL );
                }
+
+               /* Subordinates are not exposed as their own naming context */
+               if ( SLAP_GLUE_SUBORDINATE( be ) ) {
+                       BackendDB *sup_be = select_backend( &be->be_nsuffix[ 0 ], 1 );
+                       if ( sup_be == NULL ) {
+                               Debug( LDAP_DEBUG_ANY,
+                                       "monitor_subsys_database_init: "
+                                       "unable to get superior for %s\n",
+                                       be->be_suffix[ 0 ].bv_val, 0, 0 );
+
+                       } else {
+                               attr_merge( e, mi->mi_ad_monitorSuperiorDN,
+                                       sup_be->be_suffix, sup_be->be_nsuffix );
+                       }
+               }
        }
 
        (void)init_readOnly( mi, e, be->be_restrictops );
index 5f723a51b950b60c15e059e7d00d1cb734f68ba2..374cfba03312111a2465d6f468a56552f73e343a 100644 (file)
@@ -1903,6 +1903,15 @@ monitor_back_initialize(
                        "SINGLE-VALUE "
                        "USAGE dSAOperation )", SLAP_AT_HIDE,
                        offsetof(monitor_info_t, mi_ad_monitorRuntimeConfig) },
+               { "( 1.3.6.1.4.1.4203.666.1.55.30 "
+                       "NAME 'monitorSuperiorDN' "
+                       "DESC 'monitor superior DN' "
+                       /* "SUP distinguishedName " */
+                       "EQUALITY distinguishedNameMatch "
+                       "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
+                       "NO-USER-MODIFICATION "
+                       "USAGE dSAOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorSuperiorDN) },
                { NULL, 0, -1 }
        };