From: Kurt Zeilenga Date: Tue, 16 May 2000 16:42:01 +0000 (+0000) Subject: Rework root dse and other info entry codes to produce entry X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2949 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=53709873dde3fab55545c1c995759f9d2516ede4;p=openldap Rework root dse and other info entry codes to produce entry to caller (do_search) such that info can be used by other operations (ie: do_compare). --- diff --git a/servers/slapd/configinfo.c b/servers/slapd/configinfo.c index 4c9be075ce..ad2ba5d4c0 100644 --- a/servers/slapd/configinfo.c +++ b/servers/slapd/configinfo.c @@ -30,12 +30,9 @@ * 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 */ diff --git a/servers/slapd/monitor.c b/servers/slapd/monitor.c index e0903b9d53..f37dc6cdac 100644 --- a/servers/slapd/monitor.c +++ b/servers/slapd/monitor.c @@ -27,12 +27,10 @@ #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 */