From: Kurt Zeilenga Date: Thu, 15 Mar 2001 03:05:33 +0000 (+0000) Subject: Make sure we have a separator when doing suffix matching X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1490 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fd41a199c0cb3e8423230ab8ed3ecb07bbe9c210;p=openldap Make sure we have a separator when doing suffix matching --- diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 4b00ae6b76..ac82f26276 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -509,12 +509,16 @@ select_backend( len = strlen( backends[i].be_nsuffix[j] ); if ( len > dnlen ) { + /* suffix is longer than DN */ continue; } - if ( strcmp( backends[i].be_nsuffix[j], - dn + (dnlen - len) ) == 0 ) - { + if ( len < dnlen && DN_SEPARATOR( dn[(dnlen-len)-1] ) ) { + /* make sure we have a separator */ + continue; + } + + if ( strcmp( backends[i].be_nsuffix[j], &dn[dnlen-len] ) == 0 ) { if( be == NULL ) { be = &backends[i];