expcov report - Generated Sat Oct 15 21:39:18 2016

 Index  Statistics  Last 
Directory./modules/aaa
Filenamemod_authz_default.c
ModifiedWed Jul 12 12:38:44 2006

Pass Half Fail Excluded Total
Function
2
66.67%
1
33.33%
0
0.00%
3
100%
Expressions
4
13.79%
25
86.21%
0
0.00%
29
100%
Conditions
0
0.00%
0
0.00%
5
100.00%
0
0.00%
5
100%
MC/DC
0
0.00%
0
0.00%
0
0.00%
0
100%
Branches

if
0
0.00%
0
0.00%
4
100.00%
0
0.00%
4
100%
for
0
0.00%
0
0.00%
1
100.00%
0
0.00%
1
100%
while
0
0.00%
0
0.00%
0
0.00%
0
0.00%
0
100%
case
0
0.00%
0
0.00%
0
0.00%
0
0.00%
0
100%

1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements.  See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License.  You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#include "apr_strings.h"
18#include "apr_md5.h"            /* for apr_password_validate */
19
20#include "ap_config.h"
21#include "httpd.h"
22#include "http_config.h"
23#include "http_core.h"
24#include "http_log.h"
25#include "http_protocol.h"
26#include "http_request.h"
27
28typedef struct {
29    int authoritative;
30} authz_default_config_rec;
31
32static void *create_authz_default_dir_config : call=1
c
reate_authz_default_dir_config(apr_pool_t *p, char *d)
33{
34    authz_default_config_rec *conf = apr_palloc : enter=1, leave=1

apr_palloc : /usr/include/apr-1/apr_pools.h line=419 column=21
a
pr_palloc(p : modules/aaa/mod_authz_default.c line=32 column=58
p
, sizeof(*conf));
35
36    conf : modules/aaa/mod_authz_default.c line=34 column=31
c
onf-> : enter=1, leave=1
-
>authoritative : modules/aaa/mod_authz_default.c line=29 column=9
a
uthoritative = : enter=1, leave=1
=
 1; /* keep the fortress secure by default */
37    return : pass=1
r
eturn conf : modules/aaa/mod_authz_default.c line=34 column=31
c
onf;
38}
39
40static const command_rec authz_default_cmds[] =
41{
42    AP_INIT_FLAG("AuthzDefaultAuthoritative", ap_set_flag_slot : include/http_config.h line=523 column=33
a
p_set_flag_slot,
43                 (void *)APR_OFFSETOF(authz_default_config_rec, authoritative : modules/aaa/mod_authz_default.c line=29 column=9
a
uthoritative),
44                 OR_AUTHCFG,
45                 "Set to 'Off' to allow access control to be passed along to "
46                 "lower modules. (default is On.)"),
47    {NULL}
48};
49
50module AP_MODULE_DECLARE_DATA authz_default_module;
51
52static int check_user_access : call=0
c
heck_user_access(request_rec *r)
53{
54    authz_default_config_rec *conf = ap_get_module_config(r : modules/aaa/mod_authz_default.c line=52 column=43
r
-> : enter=0, leave=0
-
>per_dir_config : include/httpd.h line=977 column=30
p
er_dir_config,
55                                                 &authz_default_module : modules/aaa/mod_authz_default.c line=50 column=31
a
uthz_default_module);
56    int m = r : modules/aaa/mod_authz_default.c line=52 column=43
r
-> : enter=0, leave=0
-
>method_number : include/httpd.h line=831 column=9
m
ethod_number;
57    int method_restricted = 0;
58    register int x;
59    const apr_array_header_t *reqs_arr = ap_requires : enter=0, leave=0

ap_requires : include/http_core.h line=336 column=40
a
p_requires(r : modules/aaa/mod_authz_default.c line=52 column=43
r
);
60    require_line *reqs;
61
62    /* BUG FIX: tadc, 11-Nov-1995.  If there is no "requires" directive,
63     * then any user will do.
64     */
65    if : true=0, false=0
i
f (! : true=0, false=0
!
reqs_arr : modules/aaa/mod_authz_default.c line=59 column=31
r
eqs_arr) {
66        return : pass=0
r
eturn OK;
67    }
68    reqs : modules/aaa/mod_authz_default.c line=60 column=19
r
eqs = : pass=0
=
 (require_line *)reqs_arr : modules/aaa/mod_authz_default.c line=59 column=31
r
eqs_arr-> : enter=0, leave=0
-
>elts : /usr/include/apr-1/apr_tables.h line=62 column=11 elts;
69
70    for : true=0, false=0
f
or (x : modules/aaa/mod_authz_default.c line=58 column=18
x
 = : pass=0
=
 0; x : modules/aaa/mod_authz_default.c line=58 column=18
x
 < : true=0, false=0
<
 reqs_arr : modules/aaa/mod_authz_default.c line=59 column=31
r
eqs_arr-> : enter=0, leave=0
-
>nelts : /usr/include/apr-1/apr_tables.h line=58 column=9 nelts; x : modules/aaa/mod_authz_default.c line=58 column=18
x
++ : pass=0
+
+) {
71        if : true=0, false=0
i
f (! : true=0, false=0
!
(reqs : modules/aaa/mod_authz_default.c line=60 column=19
r
eqs[] : enter=0, leave=0
[
x : modules/aaa/mod_authz_default.c line=58 column=18
x
].method_mask : include/http_core.h line=300 column=17
m
ethod_mask & : pass=0
&
 (AP_METHOD_BIT << : pass=0
<
m : modules/aaa/mod_authz_default.c line=56 column=9
m
))) {
72            continue : pass=0
c
ontinue;
73        }
74        method_restricted : modules/aaa/mod_authz_default.c line=57 column=9
m
ethod_restricted = : pass=0
=
 1;
75        break : pass=0
b
reak;
76    }
77
78    if : true=0, false=0
i
f (method_restricted : modules/aaa/mod_authz_default.c line=57 column=9
m
ethod_restricted == : true=0, false=0
=
= 0) {
79        return : pass=0
r
eturn OK;
80    }
81
82    if : true=0, false=0
i
f (! : true=0, false=0
!
(conf : modules/aaa/mod_authz_default.c line=54 column=31
c
onf-> : enter=0, leave=0
-
>authoritative : modules/aaa/mod_authz_default.c line=29 column=9
a
uthoritative)) {
83        return : pass=0
r
eturn DECLINED;
84    }
85
86    /* if we aren't authoritative, any require directive could be
87     * considered valid even if noone groked it.  However, if we are
88     * authoritative, we can warn the user they did something wrong.
89     *
90     * That something could be a missing "AuthAuthoritative off", but
91     * more likely is a typo in the require directive.
92     */
93    ap_log_rerror : enter=0, leave=0

ap_log_rerror : include/http_log.h line=219 column=18
a
p_log_rerror(APLOG_MARK, APLOG_ERR, 0, r : modules/aaa/mod_authz_default.c line=52 column=43
r
,
94                          "access to %s failed, reason: require directives "
95                          "present and no Authoritative handler.", r : modules/aaa/mod_authz_default.c line=52 column=43
r
-> : enter=0, leave=0
-
>uri : include/httpd.h line=946 column=11
u
ri);
96
97    ap_note_auth_failure : enter=0, leave=0

ap_note_auth_failure : include/http_protocol.h line=470 column=18
a
p_note_auth_failure(r : modules/aaa/mod_authz_default.c line=52 column=43
r
);
98    return : pass=0
r
eturn HTTP_UNAUTHORIZED;
99}
100
101static void register_hooks : call=1
r
egister_hooks(apr_pool_t *p)
102{
103    ap_hook_auth_checker : enter=1, leave=1

ap_hook_auth_checker : modules/aaa/ line=224 column=1
a
p_hook_auth_checker(check_user_access : modules/aaa/mod_authz_default.c line=52 column=12
c
heck_user_access,NULL,NULL,APR_HOOK_LAST);
104}
105
106module AP_MODULE_DECLARE_DATA authz_default_module =
107{
108    STANDARD20_MODULE_STUFF,
109    create_authz_default_dir_config : modules/aaa/mod_authz_default.c line=32 column=14
c
reate_authz_default_dir_config, /* dir config creater */
110    NULL,                            /* dir merger --- default is to override */
111    NULL,                            /* server config */
112    NULL,                            /* merge server config */
113    authz_default_cmds : modules/aaa/mod_authz_default.c line=40 column=26
a
uthz_default_cmds,              /* command apr_table_t */
114    register_hooks : modules/aaa/mod_authz_default.c line=101 column=13
r
egister_hooks                   /* register hooks */
115};
116[EOF]


Generated by expcov