]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-monitor/init.c
publish updateref...
[openldap] / servers / slapd / back-monitor / init.c
index 1986aae66759e3be02c5555f06463d341471ea61..df6a08a99006f8d4b18d3e243d79386e521b432b 100644 (file)
@@ -1166,6 +1166,13 @@ monitor_back_initialize(
                        "SINGLE-VALUE "
                        "USAGE directoryOperation )", SLAP_AT_HIDE,
                        offsetof(monitor_info_t, mi_ad_monitorIsShadow) },
+               { "monitorUpdateRef", "( 1.3.6.1.4.1.4203.666.1.53 "
+                       "NAME 'monitorUpdateRef' "
+                       "DESC 'update referral for shadow databases' "
+                       "SUP monitoredInfo "
+                       "SINGLE-VALUE "
+                       "USAGE directoryOperation )", SLAP_AT_HIDE,
+                       offsetof(monitor_info_t, mi_ad_monitorUpdateRef) },
                { NULL, NULL, 0, -1 }
        };
        
@@ -1372,8 +1379,7 @@ monitor_back_db_open(
        Entry                   *e, **ep;
        monitor_entry_t         *mp;
        int                     i;
-       char                    buf[ BACKMONITOR_BUFSIZE ],
-                               *end_of_line;
+       char                    buf[ BACKMONITOR_BUFSIZE ];
        struct berval           bv;
        struct tm               *tms;
 #ifdef HAVE_GMTIME_R
@@ -1430,8 +1436,8 @@ monitor_back_db_open(
                "cn: Monitor\n"
                "description: This subtree contains monitoring/managing objects.\n"
                "description: This object contains information about this server.\n"
-               "description: Most of the information is contained in operational\n"
-               "description: attributeTypes, which must be explicitly requested.\n"
+               "description: Most of the information is held in operational"
+               " attributeTypes, which must be explicitly requested.\n"
                "creatorsName: %s\n"
                "modifiersName: %s\n"
                "createTimestamp: %s\n"
@@ -1452,20 +1458,36 @@ monitor_back_db_open(
                return( -1 );
        }
 
-       bv.bv_val = (char *) Versionstr;
-       end_of_line = strchr( Versionstr, '\n' );
-       if ( end_of_line ) {
-               bv.bv_len = end_of_line - Versionstr;
-       } else {
-               bv.bv_len = strlen( Versionstr );
-       }
+       bv.bv_val = strchr( (char *) Versionstr, '$' );
+       if ( bv.bv_val != NULL ) {
+               char    *end;
 
-       if ( attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo,
-                               &bv, NULL ) ) {
-               Debug( LDAP_DEBUG_ANY,
-                       "unable to add monitoredInfo to \"%s\" entry\n",
-                       SLAPD_MONITOR_DN, 0, 0 );
-               return( -1 );
+               bv.bv_val++;
+               for ( ; bv.bv_val[ 0 ] == ' '; bv.bv_val++ )
+                       ;
+
+               end = strchr( bv.bv_val, '$' );
+               if ( end != NULL ) {
+                       end--;
+
+                       for ( ; end > bv.bv_val && end[ 0 ] == ' '; end-- )
+                               ;
+
+                       end++;
+
+                       bv.bv_len = end - bv.bv_val;
+
+               } else {
+                       bv.bv_len = strlen( bv.bv_val );
+               }
+
+               if ( attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo,
+                                       &bv, NULL ) ) {
+                       Debug( LDAP_DEBUG_ANY,
+                               "unable to add monitoredInfo to \"%s\" entry\n",
+                               SLAPD_MONITOR_DN, 0, 0 );
+                       return( -1 );
+               }
        }
 
        mp = monitor_entrypriv_create();