mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
handle when URIs are null
This commit is contained in:
parent
dc166c08b8
commit
0fa9578f48
@ -361,29 +361,8 @@ monitor_subsys_database_init(
|
||||
li->li_bvuri, NULL );
|
||||
#else
|
||||
char **urls = ldap_str2charray( li->li_uri, " " );
|
||||
int u;
|
||||
|
||||
for ( u = 0; urls[ u ] != NULL; u++ ) {
|
||||
struct berval bv;
|
||||
|
||||
ber_str2bv( urls[ u ], 0, 0, &bv );
|
||||
|
||||
attr_merge_normalize_one( e,
|
||||
slap_schema.si_ad_labeledURI,
|
||||
&bv, NULL );
|
||||
}
|
||||
|
||||
ldap_charray_free( urls );
|
||||
#endif
|
||||
|
||||
#endif /* defined(SLAPD_LDAP) */
|
||||
#if defined(SLAPD_META)
|
||||
} else if ( strcmp( bi->bi_type, "meta" ) == 0 ) {
|
||||
metainfo_t *mi = (metainfo_t *)be->be_private;
|
||||
int t;
|
||||
|
||||
for ( t = 0; t < mi->mi_ntargets; t++ ) {
|
||||
char **urls = ldap_str2charray( mi->mi_targets[ t ].mt_uri, " " );
|
||||
if ( urls != NULL ) {
|
||||
int u;
|
||||
|
||||
for ( u = 0; urls[ u ] != NULL; u++ ) {
|
||||
@ -395,8 +374,35 @@ monitor_subsys_database_init(
|
||||
slap_schema.si_ad_labeledURI,
|
||||
&bv, NULL );
|
||||
}
|
||||
|
||||
ldap_charray_free( urls );
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* defined(SLAPD_LDAP) */
|
||||
#if defined(SLAPD_META)
|
||||
} else if ( strcmp( bi->bi_type, "meta" ) == 0 ) {
|
||||
metainfo_t *mi = (metainfo_t *)be->be_private;
|
||||
int t;
|
||||
|
||||
for ( t = 0; t < mi->mi_ntargets; t++ ) {
|
||||
char **urls = ldap_str2charray( mi->mi_targets[ t ].mt_uri, " " );
|
||||
|
||||
if ( urls != NULL ) {
|
||||
int u;
|
||||
|
||||
for ( u = 0; urls[ u ] != NULL; u++ ) {
|
||||
struct berval bv;
|
||||
|
||||
ber_str2bv( urls[ u ], 0, 0, &bv );
|
||||
|
||||
attr_merge_normalize_one( e,
|
||||
slap_schema.si_ad_labeledURI,
|
||||
&bv, NULL );
|
||||
}
|
||||
ldap_charray_free( urls );
|
||||
}
|
||||
}
|
||||
#endif /* defined(SLAPD_META) */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user