From fd41a199c0cb3e8423230ab8ed3ecb07bbe9c210 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Thu, 15 Mar 2001 03:05:33 +0000 Subject: [PATCH] Make sure we have a separator when doing suffix matching --- servers/slapd/backend.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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]; -- 2.39.5