X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fconfiginfo.c;h=51874a539f4ce5d3b28a3c33d0828cfec43b36c7;hb=2ece0ee378a47df99a05a0dd0db3763bdf9bb125;hp=4d85b2b62764c17f89be0c2741433165f2ed821d;hpb=73276e84ae32e9e148197971d1d6729739980353;p=openldap diff --git a/servers/slapd/configinfo.c b/servers/slapd/configinfo.c index 4d85b2b627..51874a539f 100644 --- a/servers/slapd/configinfo.c +++ b/servers/slapd/configinfo.c @@ -1,3 +1,8 @@ +/* $OpenLDAP$ */ +/* + * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. + * COPYING RESTRICTIONS APPLY, see COPYRIGHT file + */ /* * Copyright (c) 1995 Regents of the University of Michigan. * All rights reserved. @@ -17,7 +22,6 @@ #include #include -#include "ldap_defaults.h" #include "slap.h" #if defined( SLAPD_CONFIG_DN ) @@ -26,8 +30,9 @@ * no mutex protection in here - take our chances! */ -void -config_info( Connection *conn, Operation *op ) +int +config_info( + Entry **entry, const char **text ) { Entry *e; char buf[BUFSIZ]; @@ -42,9 +47,36 @@ config_info( Connection *conn, Operation *op ) e->e_attrs = NULL; e->e_dn = ch_strdup( SLAPD_CONFIG_DN ); - e->e_ndn = dn_normalize_case( ch_strdup( SLAPD_CONFIG_DN )); + e->e_ndn = ch_strdup( SLAPD_CONFIG_DN ); + (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, '=' ); + + if( val.bv_val != NULL ) { + *val.bv_val = '\0'; + val.bv_len = strlen( ++val.bv_val ); + + attr_merge( e, rdn, vals ); + } + + free( rdn ); + } + for ( i = 0; i < nbackends; i++ ) { strcpy( buf, backends[i].be_type ); for ( j = 0; backends[i].be_suffix[j] != NULL; j++ ) { @@ -56,12 +88,8 @@ config_info( Connection *conn, Operation *op ) attr_merge( e, "database", vals ); } - send_search_entry( &backends[0], conn, op, e, - NULL, 0, 1, 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 */