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

 Index  Statistics  Last 
Directory./modules/aaa
Filenamemod_authz_user.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
8.89%
41
91.11%
0
0.00%
45
100%
Conditions
0
0.00%
0
0.00%
8
100.00%
0
0.00%
8
100%
MC/DC
0
0.00%
0
0.00%
0
0.00%
0
100%
Branches

if
0
0.00%
0
0.00%
7
100.00%
0
0.00%
7
100%
for
0
0.00%
0
0.00%
1
100.00%
0
0.00%
1
100%
while
0
0.00%
0
0.00%
1
100.00%
0
0.00%
1
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
19#include "ap_config.h"
20#include "httpd.h"
21#include "http_config.h"
22#include "http_core.h"
23#include "http_log.h"
24#include "http_protocol.h"
25#include "http_request.h"
26
27typedef struct {
28    int authoritative;
29} authz_user_config_rec;
30
31static void *create_authz_user_dir_config : call=1
c
reate_authz_user_dir_config(apr_pool_t *p, char *d)
32{
33    authz_user_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_user.c line=31 column=55
p
, sizeof(*conf));
34
35    conf : modules/aaa/mod_authz_user.c line=33 column=28
c
onf-> : enter=1, leave=1
-
>authoritative : modules/aaa/mod_authz_user.c line=28 column=9
a
uthoritative = : enter=1, leave=1
=
 1; /* keep the fortress secure by default */
36    return : pass=1
r
eturn conf : modules/aaa/mod_authz_user.c line=33 column=28
c
onf;
37}
38
39static const command_rec authz_user_cmds[] =
40{
41    AP_INIT_FLAG("AuthzUserAuthoritative", ap_set_flag_slot : include/http_config.h line=523 column=33
a
p_set_flag_slot,
42                 (void *)APR_OFFSETOF(authz_user_config_rec, authoritative : modules/aaa/mod_authz_user.c line=28 column=9
a
uthoritative),
43                 OR_AUTHCFG,
44                 "Set to 'Off' to allow access control to be passed along to "
45                 "lower modules if the 'require user' or 'require valid-user' "
46                 "statement is not met. (default: On)."),
47    {NULL}
48};
49
50module AP_MODULE_DECLARE_DATA authz_user_module;
51
52static int check_user_access : call=0
c
heck_user_access(request_rec *r)
53{
54    authz_user_config_rec *conf = ap_get_module_config(r : modules/aaa/mod_authz_user.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_user_module : modules/aaa/mod_authz_user.c line=50 column=31
a
uthz_user_module);
56    char *user = r : modules/aaa/mod_authz_user.c line=52 column=43
r
-> : enter=0, leave=0
-
>user : include/httpd.h line=930 column=11
u
ser;
57    int m = r : modules/aaa/mod_authz_user.c line=52 column=43
r
-> : enter=0, leave=0
-
>method_number : include/httpd.h line=831 column=9
m
ethod_number;
58    int required_user = 0;
59    register int x;
60    const char *t, *w;
61    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_user.c line=52 column=43
r
);
62    require_line *reqs;
63
64    /* BUG FIX: tadc, 11-Nov-1995.  If there is no "requires" directive,
65     * then any user will do.
66     */
67    if : true=0, false=0
i
f (! : true=0, false=0
!
reqs_arr : modules/aaa/mod_authz_user.c line=61 column=31
r
eqs_arr) {
68        return : pass=0
r
eturn DECLINED;
69    }
70    reqs : modules/aaa/mod_authz_user.c line=62 column=19
r
eqs = : pass=0
=
 (require_line *)reqs_arr : modules/aaa/mod_authz_user.c line=61 column=31
r
eqs_arr-> : enter=0, leave=0
-
>elts : /usr/include/apr-1/apr_tables.h line=62 column=11 elts;
71
72    for : true=0, false=0
f
or (x : modules/aaa/mod_authz_user.c line=59 column=18
x
 = : pass=0
=
 0; x : modules/aaa/mod_authz_user.c line=59 column=18
x
 < : true=0, false=0
<
 reqs_arr : modules/aaa/mod_authz_user.c line=61 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_user.c line=59 column=18
x
++ : pass=0
+
+) {
73
74        if : true=0, false=0
i
f (! : true=0, false=0
!
(reqs : modules/aaa/mod_authz_user.c line=62 column=19
r
eqs[] : enter=0, leave=0
[
x : modules/aaa/mod_authz_user.c line=59 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_user.c line=57 column=9
m
))) {
75            continue : pass=0
c
ontinue;
76        }
77
78        t : modules/aaa/mod_authz_user.c line=60 column=17
t
 = : pass=0
=
 reqs : modules/aaa/mod_authz_user.c line=62 column=19
r
eqs[] : enter=0, leave=0
[
x : modules/aaa/mod_authz_user.c line=59 column=18
x
].requirement : include/http_core.h line=302 column=11
r
equirement;
79        w : modules/aaa/mod_authz_user.c line=60 column=21
w
 = : pass=0
=
 ap_getword_white : enter=0, leave=0

ap_getword_white : include/httpd.h line=1318 column=20
a
p_getword_white(r : modules/aaa/mod_authz_user.c line=52 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, &t : modules/aaa/mod_authz_user.c line=60 column=17
t
);
80        if : true=0, false=0
i
f (! : true=0, false=0
!
strcasecmp : enter=0, leave=0

strcasecmp : /usr/include/string.h line=536 column=12
s
trcasecmp(w : modules/aaa/mod_authz_user.c line=60 column=21
w
, "valid-user")) {
81            return : pass=0
r
eturn OK;
82        }
83        if : true=0, false=0
i
f (! : true=0, false=0
!
strcasecmp : enter=0, leave=0

strcasecmp : /usr/include/string.h line=536 column=12
s
trcasecmp(w : modules/aaa/mod_authz_user.c line=60 column=21
w
, "user")) {
84            /* And note that there are applicable requirements
85             * which we consider ourselves the owner of.
86             */
87            required_user : modules/aaa/mod_authz_user.c line=58 column=9
r
equired_user = : pass=0
=
 1;
88            while : true=0, false=0
w
hile (t : modules/aaa/mod_authz_user.c line=60 column=17
t
[] : enter=0, leave=0
[
0]) {
89                w : modules/aaa/mod_authz_user.c line=60 column=21
w
 = : pass=0
=
 ap_getword_conf : enter=0, leave=0

ap_getword_conf : include/httpd.h line=1358 column=20
a
p_getword_conf(r : modules/aaa/mod_authz_user.c line=52 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, &t : modules/aaa/mod_authz_user.c line=60 column=17
t
);
90                if : true=0, false=0
i
f (! : true=0, false=0
!
strcmp : enter=0, leave=0

strcmp : /usr/include/string.h line=143 column=12
s
trcmp(user : modules/aaa/mod_authz_user.c line=56 column=11
u
ser, w : modules/aaa/mod_authz_user.c line=60 column=21
w
)) {
91                    return : pass=0
r
eturn OK;
92                }
93            }
94        }
95    }
96
97    if : true=0, false=0
i
f (! : true=0, false=0
!
required_user : modules/aaa/mod_authz_user.c line=58 column=9
r
equired_user) {
98        /* no applicable requirements */
99        return : pass=0
r
eturn DECLINED;
100    }
101
102    if : true=0, false=0
i
f (! : true=0, false=0
!
conf : modules/aaa/mod_authz_user.c line=54 column=28
c
onf-> : enter=0, leave=0
-
>authoritative : modules/aaa/mod_authz_user.c line=28 column=9
a
uthoritative) {
103        return : pass=0
r
eturn DECLINED;
104    }
105
106    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_user.c line=52 column=43
r
,
107                  "access to %s failed, reason: user '%s' does not meet "
108                  "'require'ments for user/valid-user to be allowed access",
109                  r : modules/aaa/mod_authz_user.c line=52 column=43
r
-> : enter=0, leave=0
-
>uri : include/httpd.h line=946 column=11
u
ri, user : modules/aaa/mod_authz_user.c line=56 column=11
u
ser);
110
111    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_user.c line=52 column=43
r
);
112    return : pass=0
r
eturn HTTP_UNAUTHORIZED;
113}
114
115static void register_hooks : call=1
r
egister_hooks(apr_pool_t *p)
116{
117    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_user.c line=52 column=12
c
heck_user_access, NULL, NULL, APR_HOOK_MIDDLE);
118}
119
120module AP_MODULE_DECLARE_DATA authz_user_module =
121{
122    STANDARD20_MODULE_STUFF,
123    create_authz_user_dir_config : modules/aaa/mod_authz_user.c line=31 column=14
c
reate_authz_user_dir_config, /* dir config creater */
124    NULL,                         /* dir merger --- default is to override */
125    NULL,                         /* server config */
126    NULL,                         /* merge server config */
127    authz_user_cmds : modules/aaa/mod_authz_user.c line=39 column=26
a
uthz_user_cmds,              /* command apr_table_t */
128    register_hooks : modules/aaa/mod_authz_user.c line=115 column=13
r
egister_hooks                /* register hooks */
129};
130[EOF]


Generated by expcov