static int load_ucdata(char *path);
int
-read_config( const char *fname )
+read_config( const char *fname, int depth )
{
FILE *fp;
char *line, *savefname, *saveline;
vals[1].bv_val = NULL;
- cargv = ch_calloc( ARGS_STEP + 1, sizeof(*cargv) );
- cargv_size = ARGS_STEP + 1;
+ if ( depth == 0 ) {
+ cargv = ch_calloc( ARGS_STEP + 1, sizeof(*cargv) );
+ cargv_size = ARGS_STEP + 1;
+ }
if ( (fp = fopen( fname, "r" )) == NULL ) {
ldap_syslog = 1;
savefname = ch_strdup( cargv[1] );
savelineno = lineno;
- if ( read_config( savefname ) != 0 ) {
+ if ( read_config( savefname, depth+1 ) != 0 ) {
return( 1 );
}
}
fclose( fp );
+ if ( depth == 0 ) ch_free( cargv );
+
if ( load_ucdata( NULL ) < 0 ) return 1;
return( 0 );
}
(void) ldap_pvt_tls_set_option( NULL, LDAP_OPT_X_TLS_REQUIRE_CERT, &rc );
#endif
- if ( read_config( configfile ) != 0 ) {
+ if ( read_config( configfile, 0 ) != 0 ) {
rc = 1;
SERVICE_EXIT( ERROR_SERVICE_SPECIFIC_ERROR, 19 );
/*
* config.c
*/
-LDAP_SLAPD_F (int) read_config LDAP_P(( const char *fname ));
+LDAP_SLAPD_F (int) read_config LDAP_P(( const char *fname, int depth ));
LDAP_SLAPD_F (void) config_destroy LDAP_P ((void));
/*
exit( EXIT_FAILURE );
}
- rc = read_config( conffile );
+ rc = read_config( conffile, 0 );
if ( rc != 0 ) {
fprintf( stderr, "%s: bad configuration file!\n", progname );