3 * Copyright 1998-2000 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!
35 Entry **entry, const char **text )
40 struct berval *vals[2];
46 e = (Entry *) ch_calloc( 1, sizeof(Entry) );
49 e->e_dn = ch_strdup( SLAPD_CONFIG_DN );
50 e->e_ndn = ch_strdup( SLAPD_CONFIG_DN );
51 (void) dn_normalize( e->e_ndn );
55 val.bv_len = sizeof("top")-1;
56 attr_merge( e, "objectClass", vals );
58 val.bv_val = "LDAPsubentry";
59 val.bv_len = sizeof("LDAPsubentry")-1;
60 attr_merge( e, "objectClass", vals );
62 val.bv_val = "extensibleObject";
63 val.bv_len = sizeof("extensibleObject")-1;
64 attr_merge( e, "objectClass", vals );
67 char *rdn = ch_strdup( SLAPD_CONFIG_DN );
68 val.bv_val = strchr( rdn, '=' );
70 if( val.bv_val != NULL ) {
72 val.bv_len = strlen( ++val.bv_val );
74 attr_merge( e, rdn, vals );
80 for ( i = 0; i < nbackends; i++ ) {
81 strcpy( buf, backends[i].be_type );
82 for ( j = 0; backends[i].be_suffix[j] != NULL; j++ ) {
84 strcat( buf, backends[i].be_suffix[j]->bv_val );
87 val.bv_len = strlen( buf );
88 attr_merge( e, "database", vals );
95 #endif /* slapd_config_dn */