From: Pierangelo Masarati Date: Wed, 4 Jul 2001 20:03:49 +0000 (+0000) Subject: make slurpd honor include files in slapd.conf (note: the problem was signalled in... X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1270 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5c0502add9b9aed430aff39b75c7f5e325e20672;p=openldap make slurpd honor include files in slapd.conf (note: the problem was signalled in ITS#131 :) --- diff --git a/servers/slurpd/config.c b/servers/slurpd/config.c index db0150225e..e7a5627f59 100644 --- a/servers/slurpd/config.c +++ b/servers/slurpd/config.c @@ -111,6 +111,34 @@ slurpd_read_config( } } else if ( strcasecmp( cargv[0], "replica" ) == 0 ) { add_replica( cargv, cargc ); + + /* include another config file */ + } else if ( strcasecmp( cargv[0], "include" ) == 0 ) { + char *savefname; + int savelineno; + + if ( cargc < 2 ) { +#ifdef NEW_LOGGING + LDAP_LOG(( "config", LDAP_LEVEL_CRIT, + "%s: line %d: missing filename in \"include " + "\" line.\n", fname, lineno )); +#else + Debug( LDAP_DEBUG_ANY, + "%s: line %d: missing filename in \"include \" line\n", + fname, lineno, 0 ); +#endif + + return( 1 ); + } + savefname = strdup( cargv[1] ); + savelineno = lineno; + + if ( slurpd_read_config( savefname ) != 0 ) { + return( 1 ); + } + + free( savefname ); + lineno = savelineno - 1; } } fclose( fp );