make slurpd honor include files in slapd.conf (note: the problem was signalled in ITS#131 :)

This commit is contained in:
Pierangelo Masarati 2001-07-04 20:03:49 +00:00
parent 5ad8efbb47
commit 5c0502add9

View file

@ -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 "
"<filename>\" line.\n", fname, lineno ));
#else
Debug( LDAP_DEBUG_ANY,
"%s: line %d: missing filename in \"include <filename>\" 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 );