MCPcopy Create free account
hub / github.com/apache/httpd / check_dir_access

Function check_dir_access

modules/aaa/mod_access_compat.c:315–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

313}
314
315static int check_dir_access(request_rec *r)
316{
317 int method = r->method_number;
318 int ret = OK;
319 access_compat_dir_conf *a = (access_compat_dir_conf *)
320 ap_get_module_config(r->per_dir_config, &access_compat_module);
321
322 if (a->order[method] == ALLOW_THEN_DENY) {
323 ret = HTTP_FORBIDDEN;
324 if (find_allowdeny(r, a->allows, method)) {
325 ret = OK;
326 }
327 if (find_allowdeny(r, a->denys, method)) {
328 ret = HTTP_FORBIDDEN;
329 }
330 }
331 else if (a->order[method] == DENY_THEN_ALLOW) {
332 if (find_allowdeny(r, a->denys, method)) {
333 ret = HTTP_FORBIDDEN;
334 }
335 if (find_allowdeny(r, a->allows, method)) {
336 ret = OK;
337 }
338 }
339 else {
340 if (find_allowdeny(r, a->allows, method)
341 && !find_allowdeny(r, a->denys, method)) {
342 ret = OK;
343 }
344 else {
345 ret = HTTP_FORBIDDEN;
346 }
347 }
348
349 if (ret == HTTP_FORBIDDEN) {
350 ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01797)
351 "client denied by server configuration: %s%s",
352 r->filename ? "" : "uri ",
353 r->filename ? r->filename : r->uri);
354 }
355
356 return ret;
357}
358
359static void register_hooks(apr_pool_t *p)
360{

Callers

nothing calls this directly

Calls 2

ap_get_module_configFunction · 0.85
find_allowdenyFunction · 0.85

Tested by

no test coverage detected