Commit 0690f79a authored by Howard Chu's avatar Howard Chu
Browse files

Cleanup unknown config directive handling.

parent c5f83acf
......@@ -252,9 +252,7 @@ bdb_db_config(
/* anything else */
} else {
fprintf( stderr, "%s: line %d: "
"unknown directive \"%s\" in bdb database definition (ignored)\n",
fname, lineno, argv[0] );
return SLAP_CONF_UNKNOWN;
}
return 0;
......
......@@ -47,10 +47,7 @@ dnssrv_back_db_config(
/* no configuration options (yet) */
{
fprintf( stderr,
"%s: line %d: unknown directive \"%s\""
" in DNSSRV database definition (ignored)\n",
fname, lineno, argv[0] );
return SLAP_CONF_UNKNOWN;
}
return 0;
}
......@@ -262,9 +262,7 @@ ldap_back_db_config(
/* anything else */
} else {
fprintf( stderr, "%s: line %d: unknown directive \"%s\" "
"in ldap database definition (ignored)\n",
fname, lineno, argv[0] );
return SLAP_CONF_UNKNOWN;
}
return 0;
}
......
......@@ -199,9 +199,7 @@ ldbm_back_db_config(
/* anything else */
} else {
fprintf( stderr,
"%s: line %d: unknown directive \"%s\" in ldbm database definition (ignored)\n",
fname, lineno, argv[0] );
return SLAP_CONF_UNKNOWN;
}
return 0;
......
......@@ -565,10 +565,7 @@ meta_back_db_config(
fname, lineno, argc, argv );
/* anything else */
} else {
fprintf( stderr,
"%s: line %d: unknown directive \"%s\" in meta database definition"
" (ignored)\n",
fname, lineno, argv[0] );
return SLAP_CONF_UNKNOWN;
}
return 0;
}
......
......@@ -929,7 +929,7 @@ monitor_back_config(
/*
* eventually, will hold backend specific configuration parameters
*/
return 0;
return SLAP_CONF_UNKNOWN;
}
int
......@@ -954,15 +954,7 @@ monitor_back_db_config(
ber_str2bv( argv[ 1 ], 0, 1, &mi->mi_l );
} else {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, INFO,
"line %d of file '%s' will be ignored\n",
lineno, fname, 0 );
#else
Debug( LDAP_DEBUG_CONFIG,
"line %d of file '%s' will be ignored\n",
lineno, fname, 0 );
#endif
return SLAP_CONF_UNKNOWN;
}
return( 0 );
......
......@@ -92,9 +92,7 @@ null_back_db_config(
/* anything else */
} else {
fprintf( stderr,
"%s: line %d: unknown directive \"%s\" in null database definition (ignored)\n",
fname, lineno, argv[0] );
return SLAP_CONF_UNKNOWN;
}
return 0;
......
......@@ -66,9 +66,7 @@ passwd_back_db_config(
/* anything else */
} else {
fprintf( stderr,
"%s: line %d: unknown directive \"%s\" in passwd database definition (ignored)\n",
fname, lineno, argv[0] );
return SLAP_CONF_UNKNOWN;
}
return( 0 );
......
......@@ -122,6 +122,7 @@ perl_back_db_config(
} else if ( strcasecmp( argv[0], "filterSearchResults" ) == 0 ) {
perl_back->pb_filter_search_results = 1;
} else {
return_code = SLAP_CONF_UNKNOWN;
/*
* Pass it to Perl module if defined
*/
......@@ -157,12 +158,7 @@ perl_back_db_config(
}
/* if the module rejected it then we should reject it */
if ( return_code != 0 ) {
fprintf( stderr,
"Unknown perl backend config: %s\n", argv[0]);
exit( EXIT_FAILURE );
}
return return_code;
}
return 0;
......
......@@ -137,9 +137,7 @@ shell_back_db_config(
/* anything else */
} else {
fprintf( stderr,
"%s: line %d: unknown directive \"%s\" in shell database definition (ignored)\n",
fname, lineno, argv[0] );
return SLAP_CONF_UNKNOWN;
}
return 0;
......
......@@ -325,9 +325,7 @@ backsql_db_config(
BACKSQL_FAIL_IF_NO_MAPPING( si ) ? "yes" : "no", 0, 0 );
} else {
Debug( LDAP_DEBUG_TRACE, "<==backsql_db_config (%s line %d): "
"unknown directive \"%s\" (ignored)\n",
fname, lineno, argv[ 0 ] );
return SLAP_CONF_UNKNOWN;
}
return 0;
......
......@@ -77,7 +77,7 @@ over_db_config(
if ( oi->oi_bd.bd_info->bi_db_config ) {
rc = oi->oi_bd.bd_info->bi_db_config( &oi->oi_bd, fname, lineno,
argc, argv );
if ( rc ) return rc;
if ( rc != SLAP_CONF_UNKNOWN ) return rc;
}
bd = *be;
......@@ -86,7 +86,7 @@ over_db_config(
if (on->on_bi.bi_db_config) {
rc = on->on_bi.bi_db_config( &bd, fname, lineno,
argc, argv );
if ( rc ) break;
if ( rc != SLAP_CONF_UNKNOWN ) break;
}
}
return rc;
......
......@@ -2470,45 +2470,35 @@ 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 == 0 ) {
if ( bi->bi_config &&
( rc = (*bi->bi_config)( bi, fname, lineno, cargc, cargv ))
!= 0 && rc != SLAP_CONF_UNKNOWN ) return ( 1 );
#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
} else {
if ( (*bi->bi_config)( bi, fname, lineno, cargc, cargv )
!= 0 )
{
return( 1 );
}
}
} else if ( be != NULL ) {
if ( be->be_config == 0 ) {
if ( be->be_config &&
( rc = (*be->be_config)( be, fname, lineno, cargc, cargv ))
!= 0 && rc != SLAP_CONF_UNKNOWN ) return ( 1 );
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, INFO,
"%s: line %d: uknown 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
} else {
if ( (*be->be_config)( be, fname, lineno, cargc, cargv )
!= 0 )
{
return( 1 );
}
}
} else {
#ifdef NEW_LOGGING
LDAP_LOG( CONFIG, INFO,
......
......@@ -117,6 +117,8 @@ static int dyngroup_config(
a2->ap_mem = ap.ap_mem;
a2->ap_uri = ap.ap_uri;
on->on_bi.bi_private = a2;
} else {
return SLAP_CONF_UNKNOWN;
}
return 0;
}
......
......@@ -522,6 +522,8 @@ rwm_config(
} else if (strcasecmp( argv[0], "suffixmassage" ) == 0 ) {
rc = rwm_suffixmassage_config( be, fname, lineno, argc, argv );
} else {
rc = SLAP_CONF_UNKNOWN;
}
return rc;
......
......@@ -108,6 +108,8 @@ LDAP_BEGIN_DECL
/* psuedo error code indicating disconnect */
#define SLAPD_DISCONNECT (-2)
/* unknown config file directive */
#define SLAP_CONF_UNKNOWN (-2)
/* We assume "C" locale, that is US-ASCII */
#define ASCII_SPACE(c) ( (c) == ' ' )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment