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

 Index  Statistics  Last 
Directory./modules/aaa
Filenamemod_authn_file.c
ModifiedTue Feb 15 05:31:23 2011

Pass Half Fail Excluded Total
Function
2
40.00%
3
60.00%
0
0.00%
5
100%
Expressions
4
4.55%
84
95.45%
0
0.00%
88
100%
Conditions
0
0.00%
0
0.00%
22
100.00%
0
0.00%
22
100%
MC/DC
0
0.00%
10
100.00%
0
0.00%
10
100%
Branches

if
0
0.00%
0
0.00%
12
100.00%
0
0.00%
12
100%
for
0
0.00%
0
0.00%
0
0.00%
0
0.00%
0
100%
while
0
0.00%
0
0.00%
2
100.00%
0
0.00%
2
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 "ap_provider.h"
22#include "httpd.h"
23#include "http_config.h"
24#include "http_core.h"
25#include "http_log.h"
26#include "http_protocol.h"
27#include "http_request.h"
28
29#include "mod_auth.h"
30
31typedef struct {
32    char *pwfile;
33} authn_file_config_rec;
34
35static void *create_authn_file_dir_config : call=1
c
reate_authn_file_dir_config(apr_pool_t *p, char *d)
36{
37    authn_file_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_authn_file.c line=35 column=55
p
, sizeof(*conf));
38
39    conf : modules/aaa/mod_authn_file.c line=37 column=28
c
onf-> : enter=1, leave=1
-
>pwfile : modules/aaa/mod_authn_file.c line=32 column=11
p
wfile = : enter=1, leave=1
=
 NULL;     /* just to illustrate the default really */
40    return : pass=1
r
eturn conf : modules/aaa/mod_authn_file.c line=37 column=28
c
onf;
41}
42
43static const char *set_authn_file_slot : call=0
s
et_authn_file_slot(cmd_parms *cmd, void *offset,
44                                       const char *f, const char *t)
45{
46    if : true=0, false=0
i
f (MC/DC independently affect : true=0, false=0

t : modules/aaa/mod_authn_file.c line=44 column=67
tTF
 && : true=0, false=0
&
MC/DC independently affect : true=0, false=0
strcmp : enter=0, leave=0

strcmp : /usr/include/string.h line=143 column=12
sTF
trcmp(t : modules/aaa/mod_authn_file.c line=44 column=67
t
, "standard")) {
47        return : pass=0
r
eturn apr_pstrcat : enter=0, leave=0

apr_pstrcat : /usr/include/apr-1/apr_strings.h line=139 column=28
a
pr_pstrcat(cmd : modules/aaa/mod_authn_file.c line=43 column=51
c
md-> : enter=0, leave=0
-
>pool : include/http_config.h line=291 column=17
p
ool, "Invalid auth file type: ", t : modules/aaa/mod_authn_file.c line=44 column=67
t
, NULL);
48    }
49
50    return : pass=0
r
eturn ap_set_file_slot : enter=0, leave=0

ap_set_file_slot : include/http_config.h line=533 column=33
a
p_set_file_slot(cmd : modules/aaa/mod_authn_file.c line=43 column=51
c
md, offset : modules/aaa/mod_authn_file.c line=43 column=62
o
ffset, f : modules/aaa/mod_authn_file.c line=44 column=52
f
);
51}
52
53static const command_rec authn_file_cmds[] =
54{
55    AP_INIT_TAKE12("AuthUserFile", set_authn_file_slot : modules/aaa/mod_authn_file.c line=43 column=20
s
et_authn_file_slot,
56                   (void *)APR_OFFSETOF(authn_file_config_rec, pwfile : modules/aaa/mod_authn_file.c line=32 column=11
p
wfile),
57                   OR_AUTHCFG, "text file containing user IDs and passwords"),
58    {NULL}
59};
60
61module AP_MODULE_DECLARE_DATA authn_file_module;
62
63static authn_status check_password : call=0
c
heck_password(request_rec *r, const char *user,
64                                   const char *password)
65{
66    authn_file_config_rec *conf = ap_get_module_config(r : modules/aaa/mod_authn_file.c line=63 column=49
r
-> : enter=0, leave=0
-
>per_dir_config : include/httpd.h line=977 column=30
p
er_dir_config,
67                                                       &authn_file_module : modules/aaa/mod_authn_file.c line=61 column=31
a
uthn_file_module);
68    ap_configfile_t *f;
69    char l[MAX_STRING_LEN];
70    apr_status_t status;
71    char *file_password = NULL;
72
73    if : true=0, false=0
i
f (! : true=0, false=0
!
conf : modules/aaa/mod_authn_file.c line=66 column=28
c
onf-> : enter=0, leave=0
-
>pwfile : modules/aaa/mod_authn_file.c line=32 column=11
p
wfile) {
74        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_authn_file.c line=63 column=49
r
,
75                      "AuthUserFile not specified in the configuration");
76        return : pass=0
r
eturn AUTH_GENERAL_ERROR : modules/aaa/mod_auth.h line=50 column=5 AUTH_GENERAL_ERROR;
77    }
78
79    status : modules/aaa/mod_authn_file.c line=70 column=18
s
tatus = : pass=0
=
 ap_pcfg_openfile : enter=0, leave=0

ap_pcfg_openfile : include/http_config.h line=607 column=26
a
p_pcfg_openfile(&f : modules/aaa/mod_authn_file.c line=68 column=22
f
r : modules/aaa/mod_authn_file.c line=63 column=49
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, conf : modules/aaa/mod_authn_file.c line=66 column=28
c
onf-> : enter=0, leave=0
-
>pwfile : modules/aaa/mod_authn_file.c line=32 column=11
p
wfile);
80
81    if : true=0, false=0
i
f (status : modules/aaa/mod_authn_file.c line=70 column=18
s
tatus != : true=0, false=0
!
= APR_SUCCESS) {
82        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, status : modules/aaa/mod_authn_file.c line=70 column=18
s
tatus, r : modules/aaa/mod_authn_file.c line=63 column=49
r
,
83                      "Could not open password file: %s", conf : modules/aaa/mod_authn_file.c line=66 column=28
c
onf-> : enter=0, leave=0
-
>pwfile : modules/aaa/mod_authn_file.c line=32 column=11
p
wfile);
84        return : pass=0
r
eturn AUTH_GENERAL_ERROR : modules/aaa/mod_auth.h line=50 column=5 AUTH_GENERAL_ERROR;
85    }
86
87    while : true=0, false=0
w
hile (! : true=0, false=0
!
(ap_cfg_getline : enter=0, leave=0

ap_cfg_getline : include/http_config.h line=633 column=17
a
p_cfg_getline(l : modules/aaa/mod_authn_file.c line=69 column=10
l
, MAX_STRING_LEN, f : modules/aaa/mod_authn_file.c line=68 column=22
f
))) {
88        const char *rpw, *w;
89
90        /* Skip # or blank lines. */
91        if : true=0, false=0
i
f ((l : modules/aaa/mod_authn_file.c line=69 column=10
l
[] : enter=0, leave=0
[
0] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '#') || : true=0, false=0
|
| (! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
l : modules/aaa/mod_authn_file.c line=69 column=10
l
[] : enter=0, leave=0
[
0])) {
92            continue : pass=0
c
ontinue;
93        }
94
95        rpw : modules/aaa/mod_authn_file.c line=88 column=21
r
pw = : pass=0
=
 l : modules/aaa/mod_authn_file.c line=69 column=10
l
;
96        w : modules/aaa/mod_authn_file.c line=88 column=27
w
 = : pass=0
=
 ap_getword : enter=0, leave=0

ap_getword : include/httpd.h line=1299 column=20
a
p_getword(r : modules/aaa/mod_authn_file.c line=63 column=49
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, &rpw : modules/aaa/mod_authn_file.c line=88 column=21
r
pw, ':');
97
98        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_authn_file.c line=63 column=64
u
ser, w : modules/aaa/mod_authn_file.c line=88 column=27
w
)) {
99            file_password : modules/aaa/mod_authn_file.c line=71 column=11
f
ile_password = : pass=0
=
 ap_getword : enter=0, leave=0

ap_getword : include/httpd.h line=1299 column=20
a
p_getword(r : modules/aaa/mod_authn_file.c line=63 column=49
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, &rpw : modules/aaa/mod_authn_file.c line=88 column=21
r
pw, ':');
100            break : pass=0
b
reak;
101        }
102    }
103    ap_cfg_closefile : enter=0, leave=0

ap_cfg_closefile : include/http_config.h line=647 column=17
a
p_cfg_closefile(f : modules/aaa/mod_authn_file.c line=68 column=22
f
);
104
105    if : true=0, false=0
i
f (! : true=0, false=0
!
file_password : modules/aaa/mod_authn_file.c line=71 column=11
f
ile_password) {
106        return : pass=0
r
eturn AUTH_USER_NOT_FOUND : modules/aaa/mod_auth.h line=49 column=5 AUTH_USER_NOT_FOUND;
107    }
108
109    status : modules/aaa/mod_authn_file.c line=70 column=18
s
tatus = : pass=0
=
 apr_password_validate : enter=0, leave=0

apr_password_validate : /usr/include/apr-1/apr_md5.h line=153 column=27
a
pr_password_validate(password : modules/aaa/mod_authn_file.c line=64 column=48
p
assword, file_password : modules/aaa/mod_authn_file.c line=71 column=11
f
ile_password);
110    if : true=0, false=0
i
f (status : modules/aaa/mod_authn_file.c line=70 column=18
s
tatus != : true=0, false=0
!
= APR_SUCCESS) {
111        return : pass=0
r
eturn AUTH_DENIED : modules/aaa/mod_auth.h line=46 column=5 AUTH_DENIED;
112    }
113
114    return : pass=0
r
eturn AUTH_GRANTED : modules/aaa/mod_auth.h line=47 column=5 AUTH_GRANTED;
115}
116
117static authn_status get_realm_hash : call=0
g
et_realm_hash(request_rec *r, const char *user,
118                                   const char *realm, char **rethash)
119{
120    authn_file_config_rec *conf = ap_get_module_config(r : modules/aaa/mod_authn_file.c line=117 column=49
r
-> : enter=0, leave=0
-
>per_dir_config : include/httpd.h line=977 column=30
p
er_dir_config,
121                                                       &authn_file_module : modules/aaa/mod_authn_file.c line=61 column=31
a
uthn_file_module);
122    ap_configfile_t *f;
123    char l[MAX_STRING_LEN];
124    apr_status_t status;
125    char *file_hash = NULL;
126
127    if : true=0, false=0
i
f (! : true=0, false=0
!
conf : modules/aaa/mod_authn_file.c line=120 column=28
c
onf-> : enter=0, leave=0
-
>pwfile : modules/aaa/mod_authn_file.c line=32 column=11
p
wfile) {
128        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_authn_file.c line=117 column=49
r
,
129                      "AuthUserFile not specified in the configuration");
130        return : pass=0
r
eturn AUTH_GENERAL_ERROR : modules/aaa/mod_auth.h line=50 column=5 AUTH_GENERAL_ERROR;
131    }
132
133    status : modules/aaa/mod_authn_file.c line=124 column=18
s
tatus = : pass=0
=
 ap_pcfg_openfile : enter=0, leave=0

ap_pcfg_openfile : include/http_config.h line=607 column=26
a
p_pcfg_openfile(&f : modules/aaa/mod_authn_file.c line=122 column=22
f
r : modules/aaa/mod_authn_file.c line=117 column=49
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, conf : modules/aaa/mod_authn_file.c line=120 column=28
c
onf-> : enter=0, leave=0
-
>pwfile : modules/aaa/mod_authn_file.c line=32 column=11
p
wfile);
134
135    if : true=0, false=0
i
f (status : modules/aaa/mod_authn_file.c line=124 column=18
s
tatus != : true=0, false=0
!
= APR_SUCCESS) {
136        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, status : modules/aaa/mod_authn_file.c line=124 column=18
s
tatus, r : modules/aaa/mod_authn_file.c line=117 column=49
r
,
137                      "Could not open password file: %s", conf : modules/aaa/mod_authn_file.c line=120 column=28
c
onf-> : enter=0, leave=0
-
>pwfile : modules/aaa/mod_authn_file.c line=32 column=11
p
wfile);
138        return : pass=0
r
eturn AUTH_GENERAL_ERROR : modules/aaa/mod_auth.h line=50 column=5 AUTH_GENERAL_ERROR;
139    }
140
141    while : true=0, false=0
w
hile (! : true=0, false=0
!
(ap_cfg_getline : enter=0, leave=0

ap_cfg_getline : include/http_config.h line=633 column=17
a
p_cfg_getline(l : modules/aaa/mod_authn_file.c line=123 column=10
l
, MAX_STRING_LEN, f : modules/aaa/mod_authn_file.c line=122 column=22
f
))) {
142        const char *rpw, *w, *x;
143
144        /* Skip # or blank lines. */
145        if : true=0, false=0
i
f ((l : modules/aaa/mod_authn_file.c line=123 column=10
l
[] : enter=0, leave=0
[
0] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '#') || : true=0, false=0
|
| (! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
l : modules/aaa/mod_authn_file.c line=123 column=10
l
[] : enter=0, leave=0
[
0])) {
146            continue : pass=0
c
ontinue;
147        }
148
149        rpw : modules/aaa/mod_authn_file.c line=142 column=21
r
pw = : pass=0
=
 l : modules/aaa/mod_authn_file.c line=123 column=10
l
;
150        w : modules/aaa/mod_authn_file.c line=142 column=27
w
 = : pass=0
=
 ap_getword : enter=0, leave=0

ap_getword : include/httpd.h line=1299 column=20
a
p_getword(r : modules/aaa/mod_authn_file.c line=117 column=49
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, &rpw : modules/aaa/mod_authn_file.c line=142 column=21
r
pw, ':');
151        x : modules/aaa/mod_authn_file.c line=142 column=31
x
 = : pass=0
=
 ap_getword : enter=0, leave=0

ap_getword : include/httpd.h line=1299 column=20
a
p_getword(r : modules/aaa/mod_authn_file.c line=117 column=49
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, &rpw : modules/aaa/mod_authn_file.c line=142 column=21
r
pw, ':');
152
153        if : true=0, false=0
i
f (MC/DC independently affect : true=0, false=0

x : modules/aaa/mod_authn_file.c line=142 column=31
xTF
 && : true=0, false=0
&
MC/DC independently affect : true=0, false=0

w : modules/aaa/mod_authn_file.c line=142 column=27
wTF
 && : true=0, false=0
&
! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
strcmp : enter=0, leave=0

strcmp : /usr/include/string.h line=143 column=12
s
trcmp(user : modules/aaa/mod_authn_file.c line=117 column=64
u
ser, w : modules/aaa/mod_authn_file.c line=142 column=27
w
&& : true=0, false=0
&
! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
strcmp : enter=0, leave=0

strcmp : /usr/include/string.h line=143 column=12
s
trcmp(realm : modules/aaa/mod_authn_file.c line=118 column=48
r
ealm, x : modules/aaa/mod_authn_file.c line=142 column=31
x
)) {
154            /* Remember that this is a md5 hash of user:realm:password.  */
155            file_hash : modules/aaa/mod_authn_file.c line=125 column=11
f
ile_hash = : pass=0
=
 ap_getword : enter=0, leave=0

ap_getword : include/httpd.h line=1299 column=20
a
p_getword(r : modules/aaa/mod_authn_file.c line=117 column=49
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, &rpw : modules/aaa/mod_authn_file.c line=142 column=21
r
pw, ':');
156            break : pass=0
b
reak;
157        }
158    }
159    ap_cfg_closefile : enter=0, leave=0

ap_cfg_closefile : include/http_config.h line=647 column=17
a
p_cfg_closefile(f : modules/aaa/mod_authn_file.c line=122 column=22
f
);
160
161    if : true=0, false=0
i
f (! : true=0, false=0
!
file_hash : modules/aaa/mod_authn_file.c line=125 column=11
f
ile_hash) {
162        return : pass=0
r
eturn AUTH_USER_NOT_FOUND : modules/aaa/mod_auth.h line=49 column=5 AUTH_USER_NOT_FOUND;
163    }
164
165    *rethash : modules/aaa/mod_authn_file.c line=118 column=62
r
ethash = : enter=0, leave=0
=
 file_hash : modules/aaa/mod_authn_file.c line=125 column=11
f
ile_hash;
166
167    return : pass=0
r
eturn AUTH_USER_FOUND : modules/aaa/mod_auth.h line=48 column=5 AUTH_USER_FOUND;
168}
169
170static const authn_provider authn_file_provider =
171{
172    &check_password : modules/aaa/mod_authn_file.c line=63 column=21
c
heck_password,
173    &get_realm_hash : modules/aaa/mod_authn_file.c line=117 column=21
g
et_realm_hash,
174};
175
176static void register_hooks : call=1
r
egister_hooks(apr_pool_t *p)
177{
178    ap_register_provider : enter=1, leave=1

ap_register_provider : include/ap_provider.h line=50 column=26
a
p_register_provider(p : modules/aaa/mod_authn_file.c line=176 column=40
p
, AUTHN_PROVIDER_GROUP, "file", "0",
179                         &authn_file_provider : modules/aaa/mod_authn_file.c line=170 column=29
a
uthn_file_provider);
180}
181
182module AP_MODULE_DECLARE_DATA authn_file_module =
183{
184    STANDARD20_MODULE_STUFF,
185    create_authn_file_dir_config : modules/aaa/mod_authn_file.c line=35 column=14
c
reate_authn_file_dir_config,    /* dir config creater */
186    NULL,                            /* dir merger --- default is to override */
187    NULL,                            /* server config */
188    NULL,                            /* merge server config */
189    authn_file_cmds : modules/aaa/mod_authn_file.c line=53 column=26
a
uthn_file_cmds,                 /* command apr_table_t */
190    register_hooks : modules/aaa/mod_authn_file.c line=176 column=13
r
egister_hooks                   /* register hooks */
191};
192[EOF]


Generated by expcov