]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/monitor.c
Add OpenLDAP RCSid to *.[ch] in clients, libraries, and servers.
[openldap] / servers / slapd / monitor.c
index 891cbab2b10cb1d46c068583326d66a39dc3b1bd..9ad7fbc0806d78b7ad3c5427a3a281427181e7a3 100644 (file)
@@ -1,3 +1,8 @@
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
 /*
  * Copyright (c) 1995 Regents of the University of Michigan.
  * All rights reserved.
 #include <ac/string.h>
 #include <ac/time.h>
 
-#include "ldap_defaults.h"
 #include "slap.h"
 
 #if defined( SLAPD_MONITOR_DN )
 
 void
-monitor_info( Connection *conn, Operation *op )
+monitor_info(
+       Connection *conn,
+       Operation *op,
+       char ** attrs,
+       int attrsonly )
 {
        Entry           *e;
        char            buf[BUFSIZ];
@@ -50,6 +58,20 @@ monitor_info( Connection *conn, Operation *op )
        (void) dn_normalize_case( e->e_ndn );
        e->e_private = NULL;
 
+       {
+               char *rdn = ch_strdup( SLAPD_MONITOR_DN );
+               val.bv_val = strchr( rdn, '=' );
+
+               if( val.bv_val != NULL ) {
+                       *val.bv_val = '\0';
+                       val.bv_len = strlen( ++val.bv_val );
+
+                       attr_merge( e, rdn, vals );
+               }
+
+               free( rdn );
+       }
+
        val.bv_val = (char *) Versionstr;
        if (( p = strchr( Versionstr, '\n' )) == NULL ) {
                val.bv_len = strlen( Versionstr );
@@ -246,8 +268,20 @@ monitor_info( Connection *conn, Operation *op )
        attr_merge( e, "concurrency", vals );
 #endif
 
+       val.bv_val = "top";
+       val.bv_len = sizeof("top")-1;
+       attr_merge( e, "objectClass", vals );
+
+       val.bv_val = "LDAPsubentry";
+       val.bv_len = sizeof("LDAPsubentry")-1;
+       attr_merge( e, "objectClass", vals );
+
+       val.bv_val = "extensibleObject";
+       val.bv_len = sizeof("extensibleObject")-1;
+       attr_merge( e, "objectClass", vals );
+
        send_search_entry( &backends[0], conn, op, e,
-               NULL, 0, 1, NULL );
+               attrs, attrsonly, NULL );
        send_search_result( conn, op, LDAP_SUCCESS,
                NULL, NULL, NULL, NULL, 1 );