1998-08-09 08:43:13 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 1995 Regents of the University of Michigan.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms are permitted
|
|
|
|
* provided that this notice is preserved and that due credit is given
|
|
|
|
* to the University of Michigan at Ann Arbor. The name of the University
|
|
|
|
* may not be used to endorse or promote products derived from this
|
|
|
|
* software without specific prior written permission. This software
|
|
|
|
* is provided ``as is'' without express or implied warranty.
|
|
|
|
*/
|
|
|
|
|
1998-10-25 09:41:42 +08:00
|
|
|
#include "portable.h"
|
|
|
|
|
1998-08-09 08:43:13 +08:00
|
|
|
#include <stdio.h>
|
1998-10-25 09:41:42 +08:00
|
|
|
|
|
|
|
#include <ac/string.h>
|
|
|
|
#include <ac/socket.h>
|
|
|
|
|
1998-08-09 08:43:13 +08:00
|
|
|
#include "ldapconfig.h"
|
Protoized, moved extern definitions to .h files, fixed related bugs.
Most function and variable definitions are now preceded by its extern
definition, for error checking. Retyped a number of functions, usually
to return void. Fixed a number of printf format errors.
API changes (in ldap/include):
Added avl_dup_ok, avl_prefixapply, removed ber_fatten (probably typo
for ber_flatten), retyped ldap_sort_strcasecmp, grew lutil.h.
A number of `extern' declarations are left (some added by protoize), to
be cleaned away later. Mostly strdup(), strcasecmp(), mktemp(), optind,
optarg, errno.
1998-11-16 06:40:11 +08:00
|
|
|
#include "slap.h"
|
1998-08-09 08:43:13 +08:00
|
|
|
|
|
|
|
#if defined( SLAPD_CONFIG_DN )
|
|
|
|
|
|
|
|
/*
|
|
|
|
* no mutex protection in here - take our chances!
|
|
|
|
*/
|
|
|
|
|
|
|
|
void
|
|
|
|
config_info( Connection *conn, Operation *op )
|
|
|
|
{
|
|
|
|
Entry *e;
|
|
|
|
char buf[BUFSIZ];
|
|
|
|
struct berval val;
|
|
|
|
struct berval *vals[2];
|
|
|
|
int i, j;
|
|
|
|
|
|
|
|
vals[0] = &val;
|
|
|
|
vals[1] = NULL;
|
|
|
|
|
|
|
|
e = (Entry *) ch_calloc( 1, sizeof(Entry) );
|
1998-09-21 04:22:46 +08:00
|
|
|
|
1998-08-09 08:43:13 +08:00
|
|
|
e->e_attrs = NULL;
|
1998-11-28 04:21:54 +08:00
|
|
|
e->e_dn = ch_strdup( SLAPD_CONFIG_DN );
|
1999-02-11 02:28:25 +08:00
|
|
|
e->e_private = NULL;
|
1998-08-09 08:43:13 +08:00
|
|
|
|
|
|
|
for ( i = 0; i < nbackends; i++ ) {
|
|
|
|
strcpy( buf, backends[i].be_type );
|
|
|
|
for ( j = 0; backends[i].be_suffix[j] != NULL; j++ ) {
|
|
|
|
strcat( buf, " : " );
|
|
|
|
strcat( buf, backends[i].be_suffix[j] );
|
|
|
|
}
|
|
|
|
val.bv_val = buf;
|
|
|
|
val.bv_len = strlen( buf );
|
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
|
|
|
send_search_entry( &backends[0], conn, op, e, NULL, 0 );
|
|
|
|
send_ldap_search_result( conn, op, LDAP_SUCCESS, NULL, NULL, 1 );
|
|
|
|
|
|
|
|
entry_free( e );
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* slapd_config_dn */
|