| 3385 | } |
| 3386 | |
| 3387 | static const char *include_config (cmd_parms *cmd, void *dummy, |
| 3388 | const char *name) |
| 3389 | { |
| 3390 | ap_directive_t *conftree = NULL; |
| 3391 | const char *conffile, *error; |
| 3392 | unsigned *recursion; |
| 3393 | int optional = cmd->cmd->cmd_data ? 1 : 0; |
| 3394 | void *data; |
| 3395 | |
| 3396 | /* NOTE: ap_include_sentinel is also used by ap_process_resource_config() |
| 3397 | * during DUMP_INCLUDES; don't change its type or remove it without updating |
| 3398 | * the other. |
| 3399 | */ |
| 3400 | apr_pool_userdata_get(&data, "ap_include_sentinel", cmd->pool); |
| 3401 | if (data) { |
| 3402 | recursion = data; |
| 3403 | } |
| 3404 | else { |
| 3405 | data = recursion = apr_palloc(cmd->pool, sizeof(*recursion)); |
| 3406 | *recursion = 0; |
| 3407 | apr_pool_userdata_setn(data, "ap_include_sentinel", NULL, cmd->pool); |
| 3408 | } |
| 3409 | |
| 3410 | if (++*recursion > AP_MAX_INCLUDE_DEPTH) { |
| 3411 | *recursion = 0; |
| 3412 | return apr_psprintf(cmd->pool, "Exceeded maximum include depth of %u, " |
| 3413 | "There appears to be a recursion.", |
| 3414 | AP_MAX_INCLUDE_DEPTH); |
| 3415 | } |
| 3416 | |
| 3417 | conffile = ap_server_root_relative(cmd->pool, name); |
| 3418 | if (!conffile) { |
| 3419 | *recursion = 0; |
| 3420 | return apr_pstrcat(cmd->pool, "Invalid Include path ", |
| 3421 | name, NULL); |
| 3422 | } |
| 3423 | |
| 3424 | if (ap_exists_config_define("DUMP_INCLUDES")) { |
| 3425 | unsigned *line_number; |
| 3426 | |
| 3427 | /* NOTE: ap_include_lineno is used by ap_process_resource_config() |
| 3428 | * during DUMP_INCLUDES; don't change its type or remove it without |
| 3429 | * updating the other. |
| 3430 | */ |
| 3431 | apr_pool_userdata_get(&data, "ap_include_lineno", cmd->pool); |
| 3432 | if (data) { |
| 3433 | line_number = data; |
| 3434 | } else { |
| 3435 | data = line_number = apr_palloc(cmd->pool, sizeof(*line_number)); |
| 3436 | apr_pool_userdata_setn(data, "ap_include_lineno", NULL, cmd->pool); |
| 3437 | } |
| 3438 | |
| 3439 | *line_number = cmd->config_file->line_number; |
| 3440 | } |
| 3441 | |
| 3442 | error = ap_process_fnmatch_configs(cmd->server, conffile, &conftree, |
| 3443 | cmd->pool, cmd->temp_pool, |
| 3444 | optional); |
nothing calls this directly
no test coverage detected