version 1.113, 2006/01/03 22:12:15
|
version 1.113.2.3, 2006/05/15 17:04:41
|
Line 1
|
Line 1
|
/* root_dse.c - Provides the Root DSA-Specific Entry */ |
/* root_dse.c - Provides the Root DSA-Specific Entry */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/root_dse.c,v 1.112 2006/01/02 07:57:56 ando Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/root_dse.c,v 1.113.2.2 2006/04/18 17:33:08 kurt Exp $ */ |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
* |
* |
* Copyright 1999-2006 The OpenLDAP Foundation. |
* Copyright 1999-2006 The OpenLDAP Foundation. |
Line 214 root_dse_info(
|
Line 214 root_dse_info(
|
= slap_schema.si_ad_ref; |
= slap_schema.si_ad_ref; |
|
|
e = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) ); |
e = (Entry *) SLAP_CALLOC( 1, sizeof(Entry) ); |
|
|
if( e == NULL ) { |
if( e == NULL ) { |
Debug( LDAP_DEBUG_ANY, |
Debug( LDAP_DEBUG_ANY, |
"root_dse_info: SLAP_CALLOC failed", 0, 0, 0 ); |
"root_dse_info: SLAP_CALLOC failed", 0, 0, 0 ); |
Line 236 root_dse_info(
|
Line 235 root_dse_info(
|
/* FIXME: is this really needed? */ |
/* FIXME: is this really needed? */ |
BER_BVSTR( &val, "top" ); |
BER_BVSTR( &val, "top" ); |
if( attr_merge_one( e, ad_objectClass, &val, NULL ) ) { |
if( attr_merge_one( e, ad_objectClass, &val, NULL ) ) { |
|
fail: |
|
entry_free( e ); |
return LDAP_OTHER; |
return LDAP_OTHER; |
} |
} |
|
|
BER_BVSTR( &val, "OpenLDAProotDSE" ); |
BER_BVSTR( &val, "OpenLDAProotDSE" ); |
if( attr_merge_one( e, ad_objectClass, &val, NULL ) ) { |
if( attr_merge_one( e, ad_objectClass, &val, NULL ) ) { |
return LDAP_OTHER; |
goto fail; |
} |
} |
if( attr_merge_one( e, ad_structuralObjectClass, &val, NULL ) ) { |
if( attr_merge_one( e, ad_structuralObjectClass, &val, NULL ) ) { |
return LDAP_OTHER; |
goto fail; |
} |
} |
|
|
LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) { |
LDAP_STAILQ_FOREACH( be, &backendDB, be_next ) { |
Line 258 root_dse_info(
|
Line 259 root_dse_info(
|
&be->be_suffix[0], |
&be->be_suffix[0], |
&be->be_nsuffix[0] ) ) |
&be->be_nsuffix[0] ) ) |
{ |
{ |
return LDAP_OTHER; |
goto fail; |
} |
} |
continue; |
continue; |
} |
} |
Line 267 root_dse_info(
|
Line 268 root_dse_info(
|
&be->be_suffix[0], |
&be->be_suffix[0], |
& be->be_nsuffix[0] ) ) |
& be->be_nsuffix[0] ) ) |
{ |
{ |
return LDAP_OTHER; |
goto fail; |
} |
} |
continue; |
continue; |
} |
} |
Line 279 root_dse_info(
|
Line 280 root_dse_info(
|
&be->be_suffix[j], |
&be->be_suffix[j], |
&be->be_nsuffix[0] ) ) |
&be->be_nsuffix[0] ) ) |
{ |
{ |
return LDAP_OTHER; |
goto fail; |
} |
} |
} |
} |
} |
} |
Line 288 root_dse_info(
|
Line 289 root_dse_info(
|
|
|
/* supportedControl */ |
/* supportedControl */ |
if ( controls_root_dse_info( e ) != 0 ) { |
if ( controls_root_dse_info( e ) != 0 ) { |
return LDAP_OTHER; |
goto fail; |
} |
} |
|
|
/* supportedExtension */ |
/* supportedExtension */ |
if ( exop_root_dse_info( e ) != 0 ) { |
if ( exop_root_dse_info( e ) != 0 ) { |
return LDAP_OTHER; |
goto fail; |
} |
} |
|
|
#ifdef LDAP_SLAPI |
#ifdef LDAP_SLAPI |
/* netscape supportedExtension */ |
/* netscape supportedExtension */ |
for ( i = 0; (bv = slapi_int_get_supported_extop(i)) != NULL; i++ ) { |
for ( i = 0; (bv = slapi_int_get_supported_extop(i)) != NULL; i++ ) { |
if( attr_merge_one( e, ad_supportedExtension, bv, NULL ) ) { |
if( attr_merge_one( e, ad_supportedExtension, bv, NULL ) ) { |
return LDAP_OTHER; |
goto fail; |
} |
} |
} |
} |
#endif /* LDAP_SLAPI */ |
#endif /* LDAP_SLAPI */ |
Line 311 root_dse_info(
|
Line 312 root_dse_info(
|
} |
} |
|
|
if( attr_merge( e, ad_supportedFeatures, supportedFeatures, NULL ) ) { |
if( attr_merge( e, ad_supportedFeatures, supportedFeatures, NULL ) ) { |
return LDAP_OTHER; |
goto fail; |
} |
} |
|
|
/* supportedLDAPVersion */ |
/* supportedLDAPVersion */ |
Line 326 root_dse_info(
|
Line 327 root_dse_info(
|
val.bv_val = buf; |
val.bv_val = buf; |
val.bv_len = strlen( val.bv_val ); |
val.bv_len = strlen( val.bv_val ); |
if( attr_merge_one( e, ad_supportedLDAPVersion, &val, NULL ) ) { |
if( attr_merge_one( e, ad_supportedLDAPVersion, &val, NULL ) ) { |
return LDAP_OTHER; |
goto fail; |
} |
} |
} |
} |
|
|
Line 338 root_dse_info(
|
Line 339 root_dse_info(
|
val.bv_val = supportedSASLMechanisms[i]; |
val.bv_val = supportedSASLMechanisms[i]; |
val.bv_len = strlen( val.bv_val ); |
val.bv_len = strlen( val.bv_val ); |
if( attr_merge_one( e, ad_supportedSASLMechanisms, &val, NULL ) ) { |
if( attr_merge_one( e, ad_supportedSASLMechanisms, &val, NULL ) ) { |
return LDAP_OTHER; |
ldap_charray_free( supportedSASLMechanisms ); |
|
goto fail; |
} |
} |
} |
} |
ldap_charray_free( supportedSASLMechanisms ); |
ldap_charray_free( supportedSASLMechanisms ); |
Line 346 root_dse_info(
|
Line 348 root_dse_info(
|
|
|
if ( default_referral != NULL ) { |
if ( default_referral != NULL ) { |
if( attr_merge( e, ad_ref, default_referral, NULL /* FIXME */ ) ) { |
if( attr_merge( e, ad_ref, default_referral, NULL /* FIXME */ ) ) { |
return LDAP_OTHER; |
goto fail; |
} |
} |
} |
} |
|
|
Line 356 root_dse_info(
|
Line 358 root_dse_info(
|
if( attr_merge( e, a->a_desc, a->a_vals, |
if( attr_merge( e, a->a_desc, a->a_vals, |
(a->a_nvals == a->a_vals) ? NULL : a->a_nvals ) ) |
(a->a_nvals == a->a_vals) ? NULL : a->a_nvals ) ) |
{ |
{ |
return LDAP_OTHER; |
goto fail; |
} |
} |
} |
} |
} |
} |
Line 478 slap_discover_feature(
|
Line 480 slap_discover_feature(
|
return rc; |
return rc; |
} |
} |
|
|
rc = ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &version ); |
rc = ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, |
|
(const void *)&version ); |
if ( rc != LDAP_SUCCESS ) { |
if ( rc != LDAP_SUCCESS ) { |
goto done; |
goto done; |
} |
} |