| 2292 | } |
| 2293 | |
| 2294 | AP_DECLARE(server_rec*) ap_read_config(process_rec *process, apr_pool_t *ptemp, |
| 2295 | const char *filename, |
| 2296 | ap_directive_t **conftree) |
| 2297 | { |
| 2298 | const char *confname, *error; |
| 2299 | apr_pool_t *p = process->pconf; |
| 2300 | server_rec *s = init_server_config(process, p); |
| 2301 | if (s == NULL) { |
| 2302 | return s; |
| 2303 | } |
| 2304 | if (ap_server_conf == NULL) { |
| 2305 | ap_server_conf = s; |
| 2306 | } |
| 2307 | |
| 2308 | init_config_globals(p); |
| 2309 | |
| 2310 | if (ap_exists_config_define("DUMP_INCLUDES")) { |
| 2311 | apr_file_t *out = NULL; |
| 2312 | apr_file_open_stdout(&out, p); |
| 2313 | |
| 2314 | /* Included files will be dumped as the config is walked; print a |
| 2315 | * header. |
| 2316 | */ |
| 2317 | apr_file_printf(out, "Included configuration files:\n"); |
| 2318 | } |
| 2319 | |
| 2320 | /* All server-wide config files now have the SAME syntax... */ |
| 2321 | error = process_command_config(s, ap_server_pre_read_config, conftree, |
| 2322 | p, ptemp); |
| 2323 | if (error) { |
| 2324 | ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, 0, NULL, "%s: %s", |
| 2325 | ap_server_argv0, error); |
| 2326 | return NULL; |
| 2327 | } |
| 2328 | |
| 2329 | /* process_command_config may change the ServerRoot so |
| 2330 | * compute this config file name afterwards. |
| 2331 | */ |
| 2332 | confname = ap_server_root_relative(p, filename); |
| 2333 | |
| 2334 | if (!confname) { |
| 2335 | ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, |
| 2336 | APR_EBADPATH, NULL, APLOGNO(00532) "Invalid config file path %s", |
| 2337 | filename); |
| 2338 | return NULL; |
| 2339 | } |
| 2340 | |
| 2341 | error = ap_process_resource_config(s, confname, conftree, p, ptemp); |
| 2342 | if (error) { |
| 2343 | ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, 0, NULL, |
| 2344 | "%s: %s", ap_server_argv0, error); |
| 2345 | return NULL; |
| 2346 | } |
| 2347 | |
| 2348 | error = ap_check_mpm(); |
| 2349 | if (error) { |
| 2350 | ap_log_error(APLOG_MARK, APLOG_STARTUP|APLOG_CRIT, 0, NULL, APLOGNO(00534) |
| 2351 | "%s: Configuration error: %s", ap_server_argv0, error); |
no test coverage detected