]> git.sur5r.net Git - openldap/commitdiff
Rework root dse and other info entry codes to produce entry
authorKurt Zeilenga <kurt@openldap.org>
Tue, 16 May 2000 16:42:01 +0000 (16:42 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 16 May 2000 16:42:01 +0000 (16:42 +0000)
to caller (do_search) such that info can be used by other
operations (ie: do_compare).

servers/slapd/configinfo.c
servers/slapd/monitor.c

index 4c9be075ce427b68c5acdaf175252e1c69e9c2d0..ad2ba5d4c015f2e3fc6a96277c8adc4b295a4af2 100644 (file)
  * no mutex protection in here - take our chances!
  */
 
-void
+int
 config_info(
-       Connection *conn,
-       Operation *op,
-       char **attrs,
-       int attrsonly )
+       Entry **entry, char **text )
 {
        Entry           *e;
        char            buf[BUFSIZ];
@@ -54,6 +51,18 @@ config_info(
        (void) dn_normalize( e->e_ndn );
        e->e_private = NULL;
 
+       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 );
+
        {
                char *rdn = ch_strdup( SLAPD_CONFIG_DN );
                val.bv_val = strchr( rdn, '=' );
@@ -79,24 +88,8 @@ config_info(
                attr_merge( e, "database", vals );
        }
 
-       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,
-               attrs, attrsonly, NULL );
-       send_search_result( conn, op, LDAP_SUCCESS,
-               NULL, NULL, NULL, NULL, 1 );
-
-       entry_free( e );
+       *entry = e;
+       return LDAP_SUCCESS;
 }
 
 #endif /* slapd_config_dn */
index e0903b9d5385871c6a2ff0bc49045c6b1233d2a9..f37dc6cdac130a968b7f359bbdc7d02db26ea6e4 100644 (file)
 
 #if defined( SLAPD_MONITOR_DN )
 
-void
+int
 monitor_info(
-       Connection *conn,
-       Operation *op,
-       char ** attrs,
-       int attrsonly )
+       Entry **entry,
+       char **text )
 {
        Entry           *e;
        char            buf[BUFSIZ];
@@ -58,6 +56,18 @@ monitor_info(
        (void) dn_normalize( e->e_ndn );
        e->e_private = NULL;
 
+       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 );
+
        {
                char *rdn = ch_strdup( SLAPD_MONITOR_DN );
                val.bv_val = strchr( rdn, '=' );
@@ -251,24 +261,8 @@ monitor_info(
        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,
-               attrs, attrsonly, NULL );
-       send_search_result( conn, op, LDAP_SUCCESS,
-               NULL, NULL, NULL, NULL, 1 );
-
-       entry_free( e );
+       *entry = e;
+       return LDAP_SUCCESS;
 }
 
 #endif /* slapd_monitor_dn */