]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/configinfo.c
Add multimaster replication support (ITS#170) based upon
[openldap] / servers / slapd / configinfo.c
index df64293da42e206ad9e0f58336282c41176373b0..565a606647e6a7fa7fe1929bd8383b0c2e9cb666 100644 (file)
@@ -17,7 +17,7 @@
 #include <ac/string.h>
 #include <ac/socket.h>
 
-#include "ldapconfig.h"
+#include "ldap_defaults.h"
 #include "slap.h"
 
 #if defined( SLAPD_CONFIG_DN )
  */
 
 void
-config_info( Connection *conn, Operation *op )
+config_info(
+       Connection *conn,
+       Operation *op,
+       char **attrs,
+       int attrsonly )
 {
        Entry           *e;
        char            buf[BUFSIZ];
@@ -42,8 +46,24 @@ config_info( Connection *conn, Operation *op )
 
        e->e_attrs = NULL;
        e->e_dn = ch_strdup( SLAPD_CONFIG_DN );
+       e->e_ndn = ch_strdup( SLAPD_CONFIG_DN );
+       (void) dn_normalize_case( e->e_ndn );
        e->e_private = NULL;
 
+       {
+               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++ ) {
@@ -55,15 +75,18 @@ config_info( Connection *conn, Operation *op )
                attr_merge( e, "database", vals );
        }
 
-       if ( default_referral != NULL ) {
-               strcpy( buf, default_referral );
-               val.bv_val = buf;
-               val.bv_len = strlen( buf );
-               attr_merge( e, "database", vals );
-       }
+       val.bv_val = "top";
+       val.bv_len = sizeof("top")-1;
+       attr_merge( e, "objectClass", vals );
+
+       val.bv_val = "extenisbleObject";
+       val.bv_len = sizeof("extenisbleObject")-1;
+       attr_merge( e, "objectClass", vals );
 
-       send_search_entry( &backends[0], conn, op, e, NULL, 0 );
-       send_ldap_search_result( conn, op, LDAP_SUCCESS, NULL, NULL, 1 );
+       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 );
 }