]> git.sur5r.net Git - openldap/commitdiff
added extra check to suffix param of replica entry
authorPierangelo Masarati <ando@openldap.org>
Mon, 23 Jul 2001 14:32:59 +0000 (14:32 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 23 Jul 2001 14:32:59 +0000 (14:32 +0000)
servers/slapd/config.c

index ce3c49c27d367e970132f53057e0f64e64ac85ba..f60e26c6e8286d243b91adbe4edbb9102cf3926d 100644 (file)
@@ -1599,14 +1599,26 @@ read_config( const char *fname )
                                                if ( strncasecmp( cargv[i], "suffix=", 7 ) == 0 ) {
                                                        char *nsuffix = ch_strdup( cargv[i] + 7 );
                                                        if ( dn_normalize( nsuffix ) != NULL ) {
-                                                               charray_add( &be->be_replica[nr]->ri_nsuffix, nsuffix );
+                                                               if ( be_issuffix( be, nsuffix ) ) {
+                                                                       charray_add( &be->be_replica[nr]->ri_nsuffix, nsuffix );
+                                                               } else {
+#ifdef NEW_LOGGING
+                                                                       LDAP_LOG(( "config", LDAP_LEVEL_INFO,
+                                                                                               "%s: line %d: suffix \"%s\" in \"replica\" line is not valid for backend (ignored)\n",
+                                                                                               fname, lineno, cargv[i] + 7 ));
+#else
+                                                                       Debug( LDAP_DEBUG_ANY,
+                                                                                       "%s: line %d: suffix \"%s\" in \"replica\" line is not valid for backend (ignored)\n",
+                                                                                       fname, lineno, cargv[i] + 7 );
+#endif
+                                                               }
                                                        } else {
 #ifdef NEW_LOGGING
                                                                LDAP_LOG(( "config", LDAP_LEVEL_INFO,
                                                                                        "%s: line %d: unable to normalize suffix in \"replica\" line (ignored)\n",
                                                                                        fname, lineno ));
 #else
-                                                                Debug( LDAP_DEBUG_ANY,
+                                                               Debug( LDAP_DEBUG_ANY,
                                                                                 "%s: line %d: unable to normalize suffix in \"replica\" line (ignored)\n",
                                                                                 fname, lineno, 0 );
 #endif