mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
make sure we don't interfere with frontend's entry when the suffix is empty (test027)
This commit is contained in:
parent
7fd11ad679
commit
c0c089f4a4
@ -329,13 +329,24 @@ bdb_monitor_db_open( BackendDB *be )
|
|||||||
ldap_bv2escaped_filter_value( &be->be_nsuffix[ 0 ], &suffix );
|
ldap_bv2escaped_filter_value( &be->be_nsuffix[ 0 ], &suffix );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* just look for the naming context */
|
if ( BER_BVISEMPTY( &suffix ) ) {
|
||||||
filter->bv_len = STRLENOF( "(namingContexts:distinguishedNameMatch:=" )
|
/* frontend also has empty suffix, sigh! */
|
||||||
+ suffix.bv_len + STRLENOF( ")" );
|
filter->bv_len = STRLENOF( "(&(namingContexts:distinguishedNameMatch:=" )
|
||||||
ptr = filter->bv_val = ch_malloc( filter->bv_len + 1 );
|
+ suffix.bv_len + STRLENOF( ")(!(cn=frontend)))" );
|
||||||
ptr = lutil_strcopy( ptr, "(namingContexts:distinguishedNameMatch:=" );
|
ptr = filter->bv_val = ch_malloc( filter->bv_len + 1 );
|
||||||
ptr = lutil_strncopy( ptr, suffix.bv_val, suffix.bv_len );
|
ptr = lutil_strcopy( ptr, "(&(namingContexts:distinguishedNameMatch:=" );
|
||||||
ptr = lutil_strcopy( ptr, ")" );
|
ptr = lutil_strncopy( ptr, suffix.bv_val, suffix.bv_len );
|
||||||
|
ptr = lutil_strcopy( ptr, ")(!(cn=frontend)))" );
|
||||||
|
|
||||||
|
} else {
|
||||||
|
/* just look for the naming context */
|
||||||
|
filter->bv_len = STRLENOF( "(namingContexts:distinguishedNameMatch:=" )
|
||||||
|
+ suffix.bv_len + STRLENOF( ")" );
|
||||||
|
ptr = filter->bv_val = ch_malloc( filter->bv_len + 1 );
|
||||||
|
ptr = lutil_strcopy( ptr, "(namingContexts:distinguishedNameMatch:=" );
|
||||||
|
ptr = lutil_strncopy( ptr, suffix.bv_val, suffix.bv_len );
|
||||||
|
ptr = lutil_strcopy( ptr, ")" );
|
||||||
|
}
|
||||||
ptr[ 0 ] = '\0';
|
ptr[ 0 ] = '\0';
|
||||||
assert( filter->bv_len == ptr - filter->bv_val );
|
assert( filter->bv_len == ptr - filter->bv_val );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user