]> git.sur5r.net Git - openldap/commitdiff
cleanup handling of unknown directives ...
authorPierangelo Masarati <ando@openldap.org>
Tue, 9 Dec 2003 23:49:13 +0000 (23:49 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 9 Dec 2003 23:49:13 +0000 (23:49 +0000)
servers/slapd/config.c

index 68c3c2ac1e7a565b9538ca97a119ff69cf1888bc..56295fed6fdc5065683981a63f57682af6b3eaa1 100644 (file)
@@ -2470,34 +2470,56 @@ read_config( const char *fname, int depth )
                /* pass anything else to the current backend info/db config routine */
                } else {
                        if ( bi != NULL ) {
-                               if ( bi->bi_config &&
-                                       ( rc = (*bi->bi_config)( bi, fname, lineno, cargc, cargv ))
-                                               != 0 && rc != SLAP_CONF_UNKNOWN ) return ( 1 );
+                               if ( bi->bi_config ) {
+                                       rc = (*bi->bi_config)( bi, fname, lineno, cargc, cargv );
+
+                                       switch ( rc ) {
+                                       case 0:
+                                               break;
+
+                                       case SLAP_CONF_UNKNOWN:
 #ifdef NEW_LOGGING
-                               LDAP_LOG( CONFIG, INFO, 
-                                       "%s: line %d: unknown directive \"%s\" inside "
-                                       "backend info definition (ignored).\n",
-                                       fname, lineno, cargv[0] );
+                                               LDAP_LOG( CONFIG, INFO, 
+                                                       "%s: line %d: unknown directive \"%s\" inside "
+                                                       "backend info definition (ignored).\n",
+                                                       fname, lineno, cargv[0] );
 #else
-                               Debug( LDAP_DEBUG_ANY,
+                                               Debug( LDAP_DEBUG_ANY,
 "%s: line %d: unknown directive \"%s\" inside backend info definition (ignored)\n",
-                                       fname, lineno, cargv[0] );
+                                                       fname, lineno, cargv[0] );
 #endif
+                                               break;
+
+                                       default:
+                                               return 1;
+                                       }
+                               }
 
                        } else if ( be != NULL ) {
-                               if ( be->be_config &&
-                                       ( rc = (*be->be_config)( be, fname, lineno, cargc, cargv ))
-                                               != 0 && rc != SLAP_CONF_UNKNOWN ) return ( 1 );
+                               if ( be->be_config ) {
+                                       rc = (*be->be_config)( be, fname, lineno, cargc, cargv );
+
+                                       switch ( rc ) {
+                                       case 0:
+                                               break;
+
+                                       case SLAP_CONF_UNKNOWN:
 #ifdef NEW_LOGGING
-                               LDAP_LOG( CONFIG, INFO, 
-                                       "%s: line %d: unknown directive \"%s\" inside "
-                                       "backend database definition (ignored).\n",
-                                       fname, lineno, cargv[0] );
+                                               LDAP_LOG( CONFIG, INFO, 
+                                                       "%s: line %d: unknown directive \"%s\" inside "
+                                                       "backend database definition (ignored).\n",
+                                                       fname, lineno, cargv[0] );
 #else
-                               Debug( LDAP_DEBUG_ANY,
+                                               Debug( LDAP_DEBUG_ANY,
 "%s: line %d: unknown directive \"%s\" inside backend database definition (ignored)\n",
-                               fname, lineno, cargv[0] );
+                                                       fname, lineno, cargv[0] );
 #endif
+                                               break;
+
+                                       default:
+                                               return 1;
+                                       }
+                               }
 
                        } else {
 #ifdef NEW_LOGGING