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 )
39 struct berval val, *ndn = NULL;
40 struct berval *vals[2];
46 e = (Entry *) ch_calloc( 1, sizeof(Entry) );
50 e->e_name.bv_val = SLAPD_CONFIG_DN;
51 e->e_name.bv_len = sizeof( SLAPD_CONFIG_DN ) - 1;
55 ber_str2bv( SLAPD_CONFIG_DN, sizeof(SLAPD_CONFIG_DN)-1, 1, &e->e_name );
56 (void) dnNormalize( NULL, &e->e_name, &ndn );
62 val.bv_len = sizeof("top")-1;
63 attr_merge( e, "objectClass", vals );
65 val.bv_val = "LDAPsubentry";
66 val.bv_len = sizeof("LDAPsubentry")-1;
67 attr_merge( e, "objectClass", vals );
69 val.bv_val = "extensibleObject";
70 val.bv_len = sizeof("extensibleObject")-1;
71 attr_merge( e, "objectClass", vals );
74 val.bv_val = strchr( e->e_dn, '=' );
76 if( val.bv_val != NULL ) {
78 val.bv_len = e->e_name.bv_len - (val.bv_val-e->e_dn);
80 attr_merge( e, rdn, vals );
85 for ( i = 0; i < nbackends; i++ ) {
86 char *ptr = slap_strcopy( buf, backends[i].be_type );
87 for ( j = 0; backends[i].be_suffix[j] != NULL; j++ ) {
88 ptr = slap_strcopy( ptr, " : " );
89 ptr = slap_strcopy( ptr, backends[i].be_suffix[j]->bv_val );
92 val.bv_len = ptr - buf;
93 attr_merge( e, "database", vals );
100 #endif /* slapd_config_dn */