]> git.sur5r.net Git - openldap/commitdiff
syncrepl searchbase must be within the database naming context (ITS#5073)
authorPierangelo Masarati <ando@openldap.org>
Wed, 8 Aug 2007 18:23:22 +0000 (18:23 +0000)
committerPierangelo Masarati <ando@openldap.org>
Wed, 8 Aug 2007 18:23:22 +0000 (18:23 +0000)
servers/slapd/syncrepl.c

index e9344eabd99d644045a3c1656592cd1d2ab18b8c..289464fd4fbe82d43b8c825127a703c6b8ef3733 100644 (file)
@@ -3351,6 +3351,14 @@ parse_syncrepl_line(
                                Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 );
                                return -1;
                        }
+                       if ( select_backend( &si->si_base, 0 ) != c->be ) {
+                               ber_memfree( si->si_base.bv_val );
+                               snprintf( c->cr_msg, sizeof( c->cr_msg ),
+                                       "Base DN \"%s\" is not within the database naming context",
+                                       val );
+                               Debug( LDAP_DEBUG_ANY, "%s: %s.\n", c->log, c->cr_msg, 0 );
+                               return -1;
+                       }
                        gots |= GOT_BASE;
                } else if ( !strncasecmp( c->argv[ i ], LOGBASESTR "=",
                                        STRLENOF( LOGBASESTR "=" ) ) )