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

 Index  Statistics  Last 
Directory./modules/metadata
Filenamemod_env.c
ModifiedWed Jul 12 12:38:44 2006

Pass Half Fail Excluded Total
Function
2
28.57%
5
71.43%
0
0.00%
7
100%
Expressions
7
13.73%
44
86.27%
0
0.00%
51
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%
2
100.00%
0
0.00%
2
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.h"
18#include "apr_strings.h"
19
20#if APR_HAVE_STDLIB_H
21#include <stdlib.h>
22#endif
23
24#include "ap_config.h"
25#include "httpd.h"
26#include "http_config.h"
27#include "http_request.h"
28#include "http_log.h"
29
30typedef struct {
31    apr_table_t *vars;
32    apr_table_t *unsetenv;
33} env_dir_config_rec;
34
35module AP_MODULE_DECLARE_DATA env_module;
36
37static void *create_env_dir_config : call=1
c
reate_env_dir_config(apr_pool_t *p, char *dummy)
38{
39    env_dir_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/metadata/mod_env.c line=37 column=48
p
, sizeof(*conf));
40
41    conf : modules/metadata/mod_env.c line=39 column=25
c
onf-> : enter=1, leave=1
-
>vars : modules/metadata/mod_env.c line=31 column=18
v
ars = : enter=1, leave=1
=
 apr_table_make : enter=1, leave=1

apr_table_make : /usr/include/apr-1/apr_tables.h line=222 column=28
a
pr_table_make(p : modules/metadata/mod_env.c line=37 column=48
p
, 10);
42    conf : modules/metadata/mod_env.c line=39 column=25
c
onf-> : enter=1, leave=1
-
>unsetenv : modules/metadata/mod_env.c line=32 column=18
u
nsetenv = : enter=1, leave=1
=
 apr_table_make : enter=1, leave=1

apr_table_make : /usr/include/apr-1/apr_tables.h line=222 column=28
a
pr_table_make(p : modules/metadata/mod_env.c line=37 column=48
p
, 10);
43
44    return : pass=1
r
eturn conf : modules/metadata/mod_env.c line=39 column=25
c
onf;
45}
46
47static void *merge_env_dir_configs : call=0
m
erge_env_dir_configs(apr_pool_t *p, void *basev, void *addv)
48{
49    env_dir_config_rec *base = basev : modules/metadata/mod_env.c line=47 column=57
b
asev;
50    env_dir_config_rec *add = addv : modules/metadata/mod_env.c line=47 column=70
a
ddv;
51    env_dir_config_rec *res = apr_palloc : enter=0, leave=0

apr_palloc : /usr/include/apr-1/apr_pools.h line=419 column=21
a
pr_palloc(p : modules/metadata/mod_env.c line=47 column=48
p
, sizeof(*res));
52
53    const apr_table_entry_t *elts;
54    const apr_array_header_t *arr;
55
56    int i;
57
58    /*
59     * res->vars = copy_table( p, base->vars );
60     * foreach $unsetenv ( @add->unsetenv )
61     *     table_unset( res->vars, $unsetenv );
62     * foreach $element ( @add->vars )
63     *     table_set( res->vars, $element.key, $element.val );
64     *
65     * add->unsetenv already removed the vars from add->vars,
66     * if they preceeded the UnsetEnv directive.
67     */
68    res : modules/metadata/mod_env.c line=51 column=25
r
es-> : enter=0, leave=0
-
>vars : modules/metadata/mod_env.c line=31 column=18
v
ars = : enter=0, leave=0
=
 apr_table_copy : enter=0, leave=0

apr_table_copy : /usr/include/apr-1/apr_tables.h line=231 column=28
a
pr_table_copy(p : modules/metadata/mod_env.c line=47 column=48
p
base : modules/metadata/mod_env.c line=49 column=25
b
ase-> : enter=0, leave=0
-
>vars : modules/metadata/mod_env.c line=31 column=18
v
ars);
69    res : modules/metadata/mod_env.c line=51 column=25
r
es-> : enter=0, leave=0
-
>unsetenv : modules/metadata/mod_env.c line=32 column=18
u
nsetenv = : enter=0, leave=0
=
 NULL;
70
71    arr : modules/metadata/mod_env.c line=54 column=31
a
rr = : pass=0
=
 apr_table_elts : enter=0, leave=0

apr_table_elts : /usr/include/apr-1/apr_tables.h line=88 column=41
a
pr_table_elts(add : modules/metadata/mod_env.c line=50 column=25
a
dd-> : enter=0, leave=0
-
>unsetenv : modules/metadata/mod_env.c line=32 column=18
u
nsetenv);
72    if : true=0, false=0
i
f (arr : modules/metadata/mod_env.c line=54 column=31
a
rr) {
73        elts : modules/metadata/mod_env.c line=53 column=30
e
lts = : pass=0
=
 (const apr_table_entry_t *)arr : modules/metadata/mod_env.c line=54 column=31
a
rr-> : enter=0, leave=0
-
>elts : /usr/include/apr-1/apr_tables.h line=62 column=11 elts;
74
75        for : true=0, false=0
f
or (i : modules/metadata/mod_env.c line=56 column=9
i
 = : pass=0
=
 0; i : modules/metadata/mod_env.c line=56 column=9
i
 < : true=0, false=0
<
 arr : modules/metadata/mod_env.c line=54 column=31
a
rr-> : enter=0, leave=0
-
>nelts : /usr/include/apr-1/apr_tables.h line=58 column=9 nelts; ++ : pass=0
+
+i : modules/metadata/mod_env.c line=56 column=9
i
) {
76            apr_table_unset : enter=0, leave=0

apr_table_unset : /usr/include/apr-1/apr_tables.h line=290 column=19
a
pr_table_unset(res : modules/metadata/mod_env.c line=51 column=25
r
es-> : enter=0, leave=0
-
>vars : modules/metadata/mod_env.c line=31 column=18
v
ars, elts : modules/metadata/mod_env.c line=53 column=30
e
lts[] : enter=0, leave=0
[
i : modules/metadata/mod_env.c line=56 column=9
i
].key : /usr/include/apr-1/apr_tables.h line=73 column=11 key);
77        }
78    }
79
80    arr : modules/metadata/mod_env.c line=54 column=31
a
rr = : pass=0
=
 apr_table_elts : enter=0, leave=0

apr_table_elts : /usr/include/apr-1/apr_tables.h line=88 column=41
a
pr_table_elts(add : modules/metadata/mod_env.c line=50 column=25
a
dd-> : enter=0, leave=0
-
>vars : modules/metadata/mod_env.c line=31 column=18
v
ars);
81    if : true=0, false=0
i
f (arr : modules/metadata/mod_env.c line=54 column=31
a
rr) {
82        elts : modules/metadata/mod_env.c line=53 column=30
e
lts = : pass=0
=
 (const apr_table_entry_t *)arr : modules/metadata/mod_env.c line=54 column=31
a
rr-> : enter=0, leave=0
-
>elts : /usr/include/apr-1/apr_tables.h line=62 column=11 elts;
83
84        for : true=0, false=0
f
or (i : modules/metadata/mod_env.c line=56 column=9
i
 = : pass=0
=
 0; i : modules/metadata/mod_env.c line=56 column=9
i
 < : true=0, false=0
<
 arr : modules/metadata/mod_env.c line=54 column=31
a
rr-> : enter=0, leave=0
-
>nelts : /usr/include/apr-1/apr_tables.h line=58 column=9 nelts; ++ : pass=0
+
+i : modules/metadata/mod_env.c line=56 column=9
i
) {
85            apr_table_setn : enter=0, leave=0

apr_table_setn : /usr/include/apr-1/apr_tables.h line=282 column=19
a
pr_table_setn(res : modules/metadata/mod_env.c line=51 column=25
r
es-> : enter=0, leave=0
-
>vars : modules/metadata/mod_env.c line=31 column=18
v
ars, elts : modules/metadata/mod_env.c line=53 column=30
e
lts[] : enter=0, leave=0
[
i : modules/metadata/mod_env.c line=56 column=9
i
].key : /usr/include/apr-1/apr_tables.h line=73 column=11 key, elts : modules/metadata/mod_env.c line=53 column=30
e
lts[] : enter=0, leave=0
[
i : modules/metadata/mod_env.c line=56 column=9
i
].val : /usr/include/apr-1/apr_tables.h line=77 column=11 val);
86        }
87    }
88
89    return : pass=0
r
eturn res : modules/metadata/mod_env.c line=51 column=25
r
es;
90}
91
92static const char *add_env_module_vars_passed : call=0
a
dd_env_module_vars_passed(cmd_parms *cmd, void *sconf_,
93                                              const char *arg)
94{
95    env_dir_config_rec *sconf = sconf_ : modules/metadata/mod_env.c line=92 column=69
s
conf_;
96    apr_table_t *vars = sconf : modules/metadata/mod_env.c line=95 column=25
s
conf-> : enter=0, leave=0
-
>vars : modules/metadata/mod_env.c line=31 column=18
v
ars;
97    const char *env_var;
98
99    env_var : modules/metadata/mod_env.c line=97 column=17
e
nv_var = : pass=0
=
 getenv : enter=0, leave=0

getenv : /usr/include/stdlib.h line=567 column=14
g
etenv(arg : modules/metadata/mod_env.c line=93 column=59
a
rg);
100    if : true=0, false=0
i
f (env_var : modules/metadata/mod_env.c line=97 column=17
e
nv_var != : true=0, false=0
!
= NULL) {
101        apr_table_setn : enter=0, leave=0

apr_table_setn : /usr/include/apr-1/apr_tables.h line=282 column=19
a
pr_table_setn(vars : modules/metadata/mod_env.c line=96 column=18
v
ars, arg : modules/metadata/mod_env.c line=93 column=59
a
rg, apr_pstrdup : enter=0, leave=0

apr_pstrdup : /usr/include/apr-1/apr_strings.h line=95 column=21
a
pr_pstrdup(cmd : modules/metadata/mod_env.c line=92 column=58
c
md-> : enter=0, leave=0
-
>pool : include/http_config.h line=291 column=17
p
ool, env_var : modules/metadata/mod_env.c line=97 column=17
e
nv_var));
102    }
103    else {
104        ap_log_error : enter=0, leave=0

ap_log_error : include/http_log.h line=171 column=18
a
p_log_error(APLOG_MARK, APLOG_WARNING, 0, cmd : modules/metadata/mod_env.c line=92 column=58
c
md-> : enter=0, leave=0
-
>server : include/http_config.h line=296 column=17
s
erver,
105                     "PassEnv variable %s was undefined", arg : modules/metadata/mod_env.c line=93 column=59
a
rg);
106    }
107
108    return : pass=0
r
eturn NULL;
109}
110
111static const char *add_env_module_vars_set : call=0
a
dd_env_module_vars_set(cmd_parms *cmd, void *sconf_,
112                                           const char *name, const char *value)
113{
114    env_dir_config_rec *sconf = sconf_ : modules/metadata/mod_env.c line=111 column=66
s
conf_;
115
116    /* name is mandatory, value is optional.  no value means
117     * set the variable to an empty string
118     */
119    apr_table_setn : enter=0, leave=0

apr_table_setn : /usr/include/apr-1/apr_tables.h line=282 column=19
a
pr_table_setn(sconf : modules/metadata/mod_env.c line=114 column=25
s
conf-> : enter=0, leave=0
-
>vars : modules/metadata/mod_env.c line=31 column=18
v
ars, name : modules/metadata/mod_env.c line=112 column=56
n
ame, value : modules/metadata/mod_env.c line=112 column=74
v
alue conditional operator : true=0, false=0
?
 value : modules/metadata/mod_env.c line=112 column=74
v
alue : "");
120
121    return : pass=0
r
eturn NULL;
122}
123
124static const char *add_env_module_vars_unset : call=0
a
dd_env_module_vars_unset(cmd_parms *cmd, void *sconf_,
125                                             const char *arg)
126{
127    env_dir_config_rec *sconf = sconf_ : modules/metadata/mod_env.c line=124 column=68
s
conf_;
128
129    /* Always UnsetEnv FOO in the same context as {Set,Pass}Env FOO
130     * only if this UnsetEnv follows the {Set,Pass}Env.  The merge
131     * will only apply unsetenv to the parent env (main server).
132     */
133    apr_table_set : enter=0, leave=0

apr_table_set : /usr/include/apr-1/apr_tables.h line=269 column=19
a
pr_table_set(sconf : modules/metadata/mod_env.c line=127 column=25
s
conf-> : enter=0, leave=0
-
>unsetenv : modules/metadata/mod_env.c line=32 column=18
u
nsetenv, arg : modules/metadata/mod_env.c line=125 column=58
a
rg, NULL);
134    apr_table_unset : enter=0, leave=0

apr_table_unset : /usr/include/apr-1/apr_tables.h line=290 column=19
a
pr_table_unset(sconf : modules/metadata/mod_env.c line=127 column=25
s
conf-> : enter=0, leave=0
-
>vars : modules/metadata/mod_env.c line=31 column=18
v
ars, arg : modules/metadata/mod_env.c line=125 column=58
a
rg);
135
136    return : pass=0
r
eturn NULL;
137}
138
139static const command_rec env_module_cmds[] =
140{
141AP_INIT_ITERATE("PassEnv", add_env_module_vars_passed : modules/metadata/mod_env.c line=92 column=20
a
dd_env_module_vars_passed, NULL,
142     OR_FILEINFO, "a list of environment variables to pass to CGI."),
143AP_INIT_TAKE12("SetEnv", add_env_module_vars_set : modules/metadata/mod_env.c line=111 column=20
a
dd_env_module_vars_set, NULL,
144     OR_FILEINFO, "an environment variable name and optional value to pass to CGI."),
145AP_INIT_ITERATE("UnsetEnv", add_env_module_vars_unset : modules/metadata/mod_env.c line=124 column=20
a
dd_env_module_vars_unset, NULL,
146     OR_FILEINFO, "a list of variables to remove from the CGI environment."),
147    {NULL},
148};
149
150static int fixup_env_module : call=0
f
ixup_env_module(request_rec *r)
151{
152    apr_table_t *e = r : modules/metadata/mod_env.c line=150 column=42
r
-> : enter=0, leave=0
-
>subprocess_env : include/httpd.h line=908 column=18
s
ubprocess_env;
153    env_dir_config_rec *sconf = ap_get_module_config(r : modules/metadata/mod_env.c line=150 column=42
r
-> : enter=0, leave=0
-
>per_dir_config : include/httpd.h line=977 column=30
p
er_dir_config,
154                                                     &env_module : modules/metadata/mod_env.c line=35 column=31
e
nv_module);
155    apr_table_t *vars = sconf : modules/metadata/mod_env.c line=153 column=25
s
conf-> : enter=0, leave=0
-
>vars : modules/metadata/mod_env.c line=31 column=18
v
ars;
156
157    if : true=0, false=0
i
f (! : true=0, false=0
!
apr_table_elts : enter=0, leave=0

apr_table_elts : /usr/include/apr-1/apr_tables.h line=88 column=41
a
pr_table_elts(sconf : modules/metadata/mod_env.c line=153 column=25
s
conf-> : enter=0, leave=0
-
>vars : modules/metadata/mod_env.c line=31 column=18
v
ars)-> : enter=0, leave=0
-
>nelts : /usr/include/apr-1/apr_tables.h line=58 column=9 nelts)
158        return : pass=0
r
eturn DECLINED;
159
160    r : modules/metadata/mod_env.c line=150 column=42
r
-> : enter=0, leave=0
-
>subprocess_env : include/httpd.h line=908 column=18
s
ubprocess_env = : enter=0, leave=0
=
 apr_table_overlay : enter=0, leave=0

apr_table_overlay : /usr/include/apr-1/apr_tables.h line=346 column=28
a
pr_table_overlay(r : modules/metadata/mod_env.c line=150 column=42
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, e : modules/metadata/mod_env.c line=152 column=18
e
vars : modules/metadata/mod_env.c line=155 column=18
v
ars);
161
162    return : pass=0
r
eturn OK;
163}
164
165static void register_hooks : call=1
r
egister_hooks(apr_pool_t *p)
166{
167    ap_hook_fixups : enter=1, leave=1

ap_hook_fixups : modules/metadata/ line=171 column=1
a
p_hook_fixups(fixup_env_module : modules/metadata/mod_env.c line=150 column=12
f
ixup_env_module, NULL, NULL, APR_HOOK_MIDDLE);
168}
169
170module AP_MODULE_DECLARE_DATA env_module =
171{
172    STANDARD20_MODULE_STUFF,
173    create_env_dir_config : modules/metadata/mod_env.c line=37 column=14
c
reate_env_dir_config,      /* dir config creater */
174    merge_env_dir_configs : modules/metadata/mod_env.c line=47 column=14
m
erge_env_dir_configs,      /* dir merger --- default is to override */
175    NULL,                       /* server config */
176    NULL,                       /* merge server configs */
177    env_module_cmds : modules/metadata/mod_env.c line=139 column=26
e
nv_module_cmds,            /* command apr_table_t */
178    register_hooks : modules/metadata/mod_env.c line=165 column=13
r
egister_hooks              /* register hooks */
179};
180[EOF]


Generated by expcov