2 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6 * Copyright (c) 1995 Regents of the University of Michigan.
9 * Redistribution and use in source and binary forms are permitted
10 * provided that this notice is preserved and that due credit is given
11 * to the University of Michigan at Ann Arbor. The name of the University
12 * may not be used to endorse or promote products derived from this
13 * software without specific prior written permission. This software
14 * is provided ``as is'' without express or implied warranty.
21 #include <ac/string.h>
22 #include <ac/socket.h>
26 #if defined( SLAPD_CONFIG_DN )
29 * no mutex protection in here - take our chances!
42 struct berval *vals[2];
48 e = (Entry *) ch_calloc( 1, sizeof(Entry) );
51 e->e_dn = ch_strdup( SLAPD_CONFIG_DN );
52 e->e_ndn = ch_strdup( SLAPD_CONFIG_DN );
53 (void) dn_normalize_case( e->e_ndn );
57 char *rdn = ch_strdup( SLAPD_CONFIG_DN );
58 val.bv_val = strchr( rdn, '=' );
60 if( val.bv_val != NULL ) {
62 val.bv_len = strlen( ++val.bv_val );
64 attr_merge( e, rdn, vals );
70 for ( i = 0; i < nbackends; i++ ) {
71 strcpy( buf, backends[i].be_type );
72 for ( j = 0; backends[i].be_suffix[j] != NULL; j++ ) {
74 strcat( buf, backends[i].be_suffix[j] );
77 val.bv_len = strlen( buf );
78 attr_merge( e, "database", vals );
82 val.bv_len = sizeof("top")-1;
83 attr_merge( e, "objectClass", vals );
85 val.bv_val = "LDAPsubentry";
86 val.bv_len = sizeof("LDAPsubentry")-1;
87 attr_merge( e, "objectClass", vals );
89 val.bv_val = "extensibleObject";
90 val.bv_len = sizeof("extensibleObject")-1;
91 attr_merge( e, "objectClass", vals );
93 send_search_entry( &backends[0], conn, op, e,
94 attrs, attrsonly, NULL );
95 send_search_result( conn, op, LDAP_SUCCESS,
96 NULL, NULL, NULL, NULL, 1 );
101 #endif /* slapd_config_dn */