Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 410451 | Differences between
and this patch

Collapse All | Expand All

(-)httpd-2.4.6/include/http_config.h (+25 lines)
Lines 1321-1326 Link Here
1321
 */
1321
 */
1322
AP_DECLARE_HOOK(void,optional_fn_retrieve,(void))
1322
AP_DECLARE_HOOK(void,optional_fn_retrieve,(void))
1323
1323
1324
 /**
1325
 * Allow modules to open htaccess files or perform operations before doing so
1326
 * @param r The current request
1327
 * @param dir_name The directory for which the htaccess file should be opened
1328
 * @param access_name The filename  for which the htaccess file should be opened
1329
 * @param conffile Where the pointer to the opened ap_configfile_t must be
1330
 *        stored
1331
 * @param full_name Where the full file name of the htaccess file must be
1332
 *        stored.
1333
 * @return APR_SUCCESS on success,
1334
 *         APR_ENOENT or APR_ENOTDIR if no htaccess file exists,
1335
 *         AP_DECLINED to let later modules do the opening,
1336
 *         any other error code on error.
1337
 */
1338
AP_DECLARE_HOOK(apr_status_t,open_htaccess,
1339
                (request_rec *r, const char *dir_name, const char *access_name,
1340
                 ap_configfile_t **conffile, const char **full_name))
1341
1342
/**
1343
 * Core internal function, use ap_run_open_htaccess() instead.
1344
 */
1345
apr_status_t ap_open_htaccess(request_rec *r, const char *dir_name,
1346
        const char *access_name, ap_configfile_t **conffile,
1347
        const char **full_name);
1348
1324
/**
1349
/**
1325
 * A generic pool cleanup that will reset a pointer to NULL. For use with
1350
 * A generic pool cleanup that will reset a pointer to NULL. For use with
1326
 * apr_pool_cleanup_register.
1351
 * apr_pool_cleanup_register.
(-)httpd-2.4.6/server/config.c (-11 / +23 lines)
Lines 80-85 Link Here
80
           APR_HOOK_LINK(quick_handler)
80
           APR_HOOK_LINK(quick_handler)
81
           APR_HOOK_LINK(optional_fn_retrieve)
81
           APR_HOOK_LINK(optional_fn_retrieve)
82
           APR_HOOK_LINK(test_config)
82
           APR_HOOK_LINK(test_config)
83
           APR_HOOK_LINK(open_htaccess)
83
)
84
)
84
85
85
AP_IMPLEMENT_HOOK_RUN_ALL(int, header_parser,
86
AP_IMPLEMENT_HOOK_RUN_ALL(int, header_parser,
Lines 171-176 Link Here
171
AP_IMPLEMENT_HOOK_RUN_FIRST(int, quick_handler, (request_rec *r, int lookup),
172
AP_IMPLEMENT_HOOK_RUN_FIRST(int, quick_handler, (request_rec *r, int lookup),
172
                            (r, lookup), DECLINED)
173
                            (r, lookup), DECLINED)
173
174
175
AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, open_htaccess,
176
                            (request_rec *r, const char *dir_name, const char *access_name,
177
                             ap_configfile_t **conffile, const char **full_name),
178
                            (r, dir_name, access_name, conffile, full_name),
179
                            AP_DECLINED)
180
174
/* hooks with no args are implemented last, after disabling APR hook probes */
181
/* hooks with no args are implemented last, after disabling APR hook probes */
175
#if defined(APR_HOOK_PROBES_ENABLED)
182
#if defined(APR_HOOK_PROBES_ENABLED)
176
#undef APR_HOOK_PROBES_ENABLED
183
#undef APR_HOOK_PROBES_ENABLED
Lines 2073-2086 Link Here
2073
    return OK;
2080
    return OK;
2074
}
2081
}
2075
2082
2083
apr_status_t ap_open_htaccess(request_rec *r, const char *dir_name,
2084
                              const char *access_name,
2085
                              ap_configfile_t **conffile,
2086
                              const char **full_name)
2087
{
2088
    *full_name = ap_make_full_path(r->pool, dir_name, access_name);
2089
    return ap_pcfg_openfile(conffile, r->pool, *full_name);
2090
}
2091
2076
AP_CORE_DECLARE(int) ap_parse_htaccess(ap_conf_vector_t **result,
2092
AP_CORE_DECLARE(int) ap_parse_htaccess(ap_conf_vector_t **result,
2077
                                       request_rec *r, int override,
2093
                                       request_rec *r, int override,
2078
                                       int override_opts, apr_table_t *override_list,
2094
                                       int override_opts, apr_table_t *override_list,
2079
                                       const char *d, const char *access_name)
2095
                                       const char *d, const char *access_names)
2080
{
2096
{
2081
    ap_configfile_t *f = NULL;
2097
    ap_configfile_t *f = NULL;
2082
    cmd_parms parms;
2098
    cmd_parms parms;
2083
    char *filename = NULL;
2099
    const char *filename;
2084
    const struct htaccess_result *cache;
2100
    const struct htaccess_result *cache;
2085
    struct htaccess_result *new;
2101
    struct htaccess_result *new;
2086
    ap_conf_vector_t *dc = NULL;
2102
    ap_conf_vector_t *dc = NULL;
Lines 2104-2118 Link Here
2104
    parms.path = apr_pstrdup(r->pool, d);
2120
    parms.path = apr_pstrdup(r->pool, d);
2105
2121
2106
    /* loop through the access names and find the first one */
2122
    /* loop through the access names and find the first one */
2107
    while (access_name[0]) {
2123
    while (access_names[0]) {
2108
        /* AFAICT; there is no use of the actual 'filename' against
2124
        const char *access_name = ap_getword_conf(r->pool, &access_names);
2109
         * any canonicalization, so we will simply take the given
2125
 
2110
         * name, ignoring case sensitivity and aliases
2126
        filename = NULL;
2111
         */
2127
        status = ap_run_open_htaccess(r, d, access_name, &f, &filename);
2112
        filename = ap_make_full_path(r->pool, d,
2113
                                     ap_getword_conf(r->pool, &access_name));
2114
        status = ap_pcfg_openfile(&f, r->pool, filename);
2115
2116
        if (status == APR_SUCCESS) {
2128
        if (status == APR_SUCCESS) {
2117
            const char *errmsg;
2129
            const char *errmsg;
2118
            ap_directive_t *temptree = NULL;
2130
            ap_directive_t *temptree = NULL;
(-)httpd-2.4.6/server/core.c (+1 lines)
Lines 4878-4883 Link Here
4878
    ap_hook_insert_network_bucket(core_insert_network_bucket, NULL, NULL,
4878
    ap_hook_insert_network_bucket(core_insert_network_bucket, NULL, NULL,
4879
                                  APR_HOOK_REALLY_LAST);
4879
                                  APR_HOOK_REALLY_LAST);
4880
    ap_hook_dirwalk_stat(core_dirwalk_stat, NULL, NULL, APR_HOOK_REALLY_LAST);
4880
    ap_hook_dirwalk_stat(core_dirwalk_stat, NULL, NULL, APR_HOOK_REALLY_LAST);
4881
    ap_hook_open_htaccess(ap_open_htaccess, NULL, NULL, APR_HOOK_REALLY_LAST);
4881
    
4882
    
4882
    /* register the core's insert_filter hook and register core-provided
4883
    /* register the core's insert_filter hook and register core-provided
4883
     * filters
4884
     * filters

Return to bug 410451