3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 * Copyright (c) 1995 Regents of the University of Michigan.
10 * Redistribution and use in source and binary forms are permitted
11 * provided that this notice is preserved and that due credit is given
12 * to the University of Michigan at Ann Arbor. The name of the University
13 * may not be used to endorse or promote products derived from this
14 * software without specific prior written permission. This software
15 * is provided ``as is'' without express or implied warranty.
22 #include <ac/string.h>
23 #include <ac/socket.h>
27 #if defined( SLAPD_CONFIG_DN )
30 * no mutex protection in here - take our chances!
43 struct berval *vals[2];
49 e = (Entry *) ch_calloc( 1, sizeof(Entry) );
52 e->e_dn = ch_strdup( SLAPD_CONFIG_DN );
53 e->e_ndn = ch_strdup( SLAPD_CONFIG_DN );
54 (void) dn_normalize( e->e_ndn );
58 char *rdn = ch_strdup( SLAPD_CONFIG_DN );
59 val.bv_val = strchr( rdn, '=' );
61 if( val.bv_val != NULL ) {
63 val.bv_len = strlen( ++val.bv_val );
65 attr_merge( e, rdn, vals );
71 for ( i = 0; i < nbackends; i++ ) {
72 strcpy( buf, backends[i].be_type );
73 for ( j = 0; backends[i].be_suffix[j] != NULL; j++ ) {
75 strcat( buf, backends[i].be_suffix[j] );
78 val.bv_len = strlen( buf );
79 attr_merge( e, "database", vals );
83 val.bv_len = sizeof("top")-1;
84 attr_merge( e, "objectClass", vals );
86 val.bv_val = "LDAPsubentry";
87 val.bv_len = sizeof("LDAPsubentry")-1;
88 attr_merge( e, "objectClass", vals );
90 val.bv_val = "extensibleObject";
91 val.bv_len = sizeof("extensibleObject")-1;
92 attr_merge( e, "objectClass", vals );
94 send_search_entry( &backends[0], conn, op, e,
95 attrs, attrsonly, NULL );
96 send_search_result( conn, op, LDAP_SUCCESS,
97 NULL, NULL, NULL, NULL, 1 );
102 #endif /* slapd_config_dn */