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

 Index  Statistics  Last 
Directory./modules/mappers
Filenamemod_userdir.c
ModifiedTue Feb 8 11:58:51 2011

Pass Half Fail Excluded Total
Function
2
33.33%
4
66.67%
0
0.00%
6
100%
Expressions
9
5.66%
150
94.34%
0
0.00%
159
100%
Conditions
0
0.00%
0
0.00%
48
100.00%
0
0.00%
48
100%
MC/DC
0
0.00%
24
100.00%
0
0.00%
24
100%
Branches

if
0
0.00%
0
0.00%
22
100.00%
0
0.00%
22
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/*
18 * mod_userdir... implement the UserDir command.  Broken away from the
19 * Alias stuff for a couple of good and not-so-good reasons:
20 *
21 * 1) It shows a real minimal working example of how to do something like
22 *    this.
23 * 2) I know people who are actually interested in changing this *particular*
24 *    aspect of server functionality without changing the rest of it.  That's
25 *    what this whole modular arrangement is supposed to be good at...
26 *
27 * Modified by Alexei Kosut to support the following constructs
28 * (server running at www.foo.com, request for /~bar/one/two.html)
29 *
30 * UserDir public_html      -> ~bar/public_html/one/two.html
31 * UserDir /usr/web         -> /usr/web/bar/one/two.html
32 * UserDir /home/ * /www     -> /home/bar/www/one/two.html
33 *  NOTE: theses ^ ^ space only added allow it to work in a comment, ignore
34 * UserDir http://x/users   -> (302) http://x/users/bar/one/two.html
35 * UserDir http://x/ * /y     -> (302) http://x/bar/y/one/two.html
36 *  NOTE: here also ^ ^
37 *
38 * In addition, you can use multiple entries, to specify alternate
39 * user directories (a la Directory Index). For example:
40 *
41 * UserDir public_html /usr/web http://www.xyz.com/users
42 *
43 * Modified by Ken Coar to provide for the following:
44 *
45 * UserDir disable[d] username ...
46 * UserDir enable[d] username ...
47 *
48 * If "disabled" has no other arguments, *all* ~<username> references are
49 * disabled, except those explicitly turned on with the "enabled" keyword.
50 */
51
52#include "apr_strings.h"
53#include "apr_user.h"
54
55#define APR_WANT_STRFUNC
56#include "apr_want.h"
57
58#if APR_HAVE_UNISTD_H
59#include <unistd.h>
60#endif
61
62#include "ap_config.h"
63#include "httpd.h"
64#include "http_config.h"
65#include "http_request.h"
66
67#if !defined(WIN32) && !defined(OS2) && !defined(BEOS) && !defined(NETWARE)
68#define HAVE_UNIX_SUEXEC
69#endif
70
71#ifdef HAVE_UNIX_SUEXEC
72#include "unixd.h"        /* Contains the suexec_identity hook used on Unix */
73#endif
74
75
76/*
77 * The default directory in user's home dir
78 * In the default install, the module is disabled
79 */
80#ifndef DEFAULT_USER_DIR
81#define DEFAULT_USER_DIR NULL
82#endif
83
84#define O_DEFAULT 0
85#define O_ENABLE 1
86#define O_DISABLE 2
87
88module AP_MODULE_DECLARE_DATA userdir_module;
89
90typedef struct {
91    int globally_disabled;
92    char *userdir;
93    apr_table_t *enabled_users;
94    apr_table_t *disabled_users;
95} userdir_config;
96
97/*
98 * Server config for this module: global disablement flag, a list of usernames
99 * ineligible for UserDir access, a list of those immune to global (but not
100 * explicit) disablement, and the replacement string for all others.
101 */
102
103static void *create_userdir_config : call=1
c
reate_userdir_config(apr_pool_t *p, server_rec *s)
104{
105    userdir_config *newcfg = apr_pcalloc(p : modules/mappers/mod_userdir.c line=103 column=48
p
, sizeof(*newcfg));
106
107    newcfg : modules/mappers/mod_userdir.c line=105 column=21
n
ewcfg-> : enter=1, leave=1
-
>globally_disabled : modules/mappers/mod_userdir.c line=91 column=9
g
lobally_disabled = : enter=1, leave=1
=
 O_DEFAULT;
108    newcfg : modules/mappers/mod_userdir.c line=105 column=21
n
ewcfg-> : enter=1, leave=1
-
>userdir : modules/mappers/mod_userdir.c line=92 column=11
u
serdir = : enter=1, leave=1
=
 DEFAULT_USER_DIR;
109    newcfg : modules/mappers/mod_userdir.c line=105 column=21
n
ewcfg-> : enter=1, leave=1
-
>enabled_users : modules/mappers/mod_userdir.c line=93 column=18
e
nabled_users = : 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/mappers/mod_userdir.c line=103 column=48
p
, 4);
110    newcfg : modules/mappers/mod_userdir.c line=105 column=21
n
ewcfg-> : enter=1, leave=1
-
>disabled_users : modules/mappers/mod_userdir.c line=94 column=18
d
isabled_users = : 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/mappers/mod_userdir.c line=103 column=48
p
, 4);
111
112    return : pass=1
r
eturn newcfg : modules/mappers/mod_userdir.c line=105 column=21
n
ewcfg;
113}
114
115static void *merge_userdir_config : call=0
m
erge_userdir_config(apr_pool_t *p, void *basev, void *overridesv)
116{
117    userdir_config *cfg = apr_pcalloc(p : modules/mappers/mod_userdir.c line=115 column=47
p
, sizeof(userdir_config));
118    userdir_config *base = basev : modules/mappers/mod_userdir.c line=115 column=56
b
asev, *overrides = overridesv : modules/mappers/mod_userdir.c line=115 column=69
o
verridesv;
119 
120    cfg : modules/mappers/mod_userdir.c line=117 column=21
c
fg-> : enter=0, leave=0
-
>globally_disabled : modules/mappers/mod_userdir.c line=91 column=9
g
lobally_disabled = : enter=0, leave=0
=
 (overrides : modules/mappers/mod_userdir.c line=118 column=36
o
verrides-> : enter=0, leave=0
-
>globally_disabled : modules/mappers/mod_userdir.c line=91 column=9
g
lobally_disabled != : true=0, false=0
!
= O_DEFAULT) conditional operator : true=0, false=0
?
 overrides : modules/mappers/mod_userdir.c line=118 column=36
o
verrides-> : enter=0, leave=0
-
>globally_disabled : modules/mappers/mod_userdir.c line=91 column=9
g
lobally_disabled : base : modules/mappers/mod_userdir.c line=118 column=21
b
ase-> : enter=0, leave=0
-
>globally_disabled : modules/mappers/mod_userdir.c line=91 column=9
g
lobally_disabled;
121    cfg : modules/mappers/mod_userdir.c line=117 column=21
c
fg-> : enter=0, leave=0
-
>userdir : modules/mappers/mod_userdir.c line=92 column=11
u
serdir = : enter=0, leave=0
=
 (overrides : modules/mappers/mod_userdir.c line=118 column=36
o
verrides-> : enter=0, leave=0
-
>userdir : modules/mappers/mod_userdir.c line=92 column=11
u
serdir != : true=0, false=0
!
= DEFAULT_USER_DIR) conditional operator : true=0, false=0
?
 overrides : modules/mappers/mod_userdir.c line=118 column=36
o
verrides-> : enter=0, leave=0
-
>userdir : modules/mappers/mod_userdir.c line=92 column=11
u
serdir : base : modules/mappers/mod_userdir.c line=118 column=21
b
ase-> : enter=0, leave=0
-
>userdir : modules/mappers/mod_userdir.c line=92 column=11
u
serdir;
122 
123    /* not merged */
124    cfg : modules/mappers/mod_userdir.c line=117 column=21
c
fg-> : enter=0, leave=0
-
>enabled_users : modules/mappers/mod_userdir.c line=93 column=18
e
nabled_users = : enter=0, leave=0
=
 overrides : modules/mappers/mod_userdir.c line=118 column=36
o
verrides-> : enter=0, leave=0
-
>enabled_users : modules/mappers/mod_userdir.c line=93 column=18
e
nabled_users;
125    cfg : modules/mappers/mod_userdir.c line=117 column=21
c
fg-> : enter=0, leave=0
-
>disabled_users : modules/mappers/mod_userdir.c line=94 column=18
d
isabled_users = : enter=0, leave=0
=
 overrides : modules/mappers/mod_userdir.c line=118 column=36
o
verrides-> : enter=0, leave=0
-
>disabled_users : modules/mappers/mod_userdir.c line=94 column=18
d
isabled_users;
126    
127    return : pass=0
r
eturn cfg : modules/mappers/mod_userdir.c line=117 column=21
c
fg;
128}
129
130
131static const char *set_user_dir : call=0
s
et_user_dir(cmd_parms *cmd, void *dummy, const char *arg)
132{
133    userdir_config *s_cfg = ap_get_module_config(cmd : modules/mappers/mod_userdir.c line=131 column=44
c
md-> : enter=0, leave=0
-
>server : include/http_config.h line=296 column=17
s
erver-> : enter=0, leave=0
-
>module_config : include/httpd.h line=1207 column=30
m
odule_config,
134                                                 &userdir_module : modules/mappers/mod_userdir.c line=88 column=31
u
serdir_module);
135    char *username;
136    const char *usernames = arg : modules/mappers/mod_userdir.c line=131 column=74
a
rg;
137    char *kw = ap_getword_conf : enter=0, leave=0

ap_getword_conf : include/httpd.h line=1358 column=20
a
p_getword_conf(cmd : modules/mappers/mod_userdir.c line=131 column=44
c
md-> : enter=0, leave=0
-
>pool : include/http_config.h line=291 column=17
p
ool, &usernames : modules/mappers/mod_userdir.c line=136 column=17
u
sernames);
138    apr_table_t *usertable;
139
140    /* Since we are a raw argument, it is possible for us to be called with
141     * zero arguments.  So that we aren't ambiguous, flat out reject this.
142     */
143    if : true=0, false=0
i
f (* dereference : enter=0, leave=0
*
kw : modules/mappers/mod_userdir.c line=137 column=11
k
== : true=0, false=0
=
= '\0') {
144        return : pass=0
r
eturn "UserDir requires an argument.";
145    }
146
147    /*
148     * Let's do the comparisons once.
149     */
150    if : true=0, false=0
i
f ((! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
strcasecmp : enter=0, leave=0

strcasecmp : /usr/include/string.h line=536 column=12
s
trcasecmp(kw : modules/mappers/mod_userdir.c line=137 column=11
k
w, "disable")) || : true=0, false=0
|
| (! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
strcasecmp : enter=0, leave=0

strcasecmp : /usr/include/string.h line=536 column=12
s
trcasecmp(kw : modules/mappers/mod_userdir.c line=137 column=11
k
w, "disabled"))) {
151        /*
152         * If there are no usernames specified, this is a global disable - we
153         * need do no more at this point than record the fact.
154         */
155        if : true=0, false=0
i
f (strlen : enter=0, leave=0

strlen : /usr/include/string.h line=399 column=15
s
trlen(usernames : modules/mappers/mod_userdir.c line=136 column=17
u
sernames) == : true=0, false=0
=
= 0) {
156            s_cfg : modules/mappers/mod_userdir.c line=133 column=21
s
_cfg-> : enter=0, leave=0
-
>globally_disabled : modules/mappers/mod_userdir.c line=91 column=9
g
lobally_disabled = : enter=0, leave=0
=
 O_DISABLE;
157            return : pass=0
r
eturn NULL;
158        }
159        usertable : modules/mappers/mod_userdir.c line=138 column=18
u
sertable = : pass=0
=
 s_cfg : modules/mappers/mod_userdir.c line=133 column=21
s
_cfg-> : enter=0, leave=0
-
>disabled_users : modules/mappers/mod_userdir.c line=94 column=18
d
isabled_users;
160    }
161    else if : true=0, false=0
i
f ((! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
strcasecmp : enter=0, leave=0

strcasecmp : /usr/include/string.h line=536 column=12
s
trcasecmp(kw : modules/mappers/mod_userdir.c line=137 column=11
k
w, "enable")) || : true=0, false=0
|
| (! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
strcasecmp : enter=0, leave=0

strcasecmp : /usr/include/string.h line=536 column=12
s
trcasecmp(kw : modules/mappers/mod_userdir.c line=137 column=11
k
w, "enabled"))) {
162        if : true=0, false=0
i
f (strlen : enter=0, leave=0

strlen : /usr/include/string.h line=399 column=15
s
trlen(usernames : modules/mappers/mod_userdir.c line=136 column=17
u
sernames) == : true=0, false=0
=
= 0) {
163            s_cfg : modules/mappers/mod_userdir.c line=133 column=21
s
_cfg-> : enter=0, leave=0
-
>globally_disabled : modules/mappers/mod_userdir.c line=91 column=9
g
lobally_disabled = : enter=0, leave=0
=
 O_ENABLE;
164            return : pass=0
r
eturn NULL;
165        }
166        usertable : modules/mappers/mod_userdir.c line=138 column=18
u
sertable = : pass=0
=
 s_cfg : modules/mappers/mod_userdir.c line=133 column=21
s
_cfg-> : enter=0, leave=0
-
>enabled_users : modules/mappers/mod_userdir.c line=93 column=18
e
nabled_users;
167    }
168    else {
169        /*
170         * If the first (only?) value isn't one of our keywords, just copy
171         * the string to the userdir string.
172         */
173        s_cfg : modules/mappers/mod_userdir.c line=133 column=21
s
_cfg-> : enter=0, leave=0
-
>userdir : modules/mappers/mod_userdir.c line=92 column=11
u
serdir = : enter=0, leave=0
=
 apr_pstrdup : enter=0, leave=0

apr_pstrdup : /usr/include/apr-1/apr_strings.h line=95 column=21
a
pr_pstrdup(cmd : modules/mappers/mod_userdir.c line=131 column=44
c
md-> : enter=0, leave=0
-
>pool : include/http_config.h line=291 column=17
p
ool, arg : modules/mappers/mod_userdir.c line=131 column=74
a
rg);
174        return : pass=0
r
eturn NULL;
175    }
176    /*
177     * Now we just take each word in turn from the command line and add it to
178     * the appropriate table.
179     */
180    while : true=0, false=0
w
hile (* dereference : enter=0, leave=0
*
usernames : modules/mappers/mod_userdir.c line=136 column=17
u
sernames) {
181        username : modules/mappers/mod_userdir.c line=135 column=11
u
sername = : pass=0
=
 ap_getword_conf : enter=0, leave=0

ap_getword_conf : include/httpd.h line=1358 column=20
a
p_getword_conf(cmd : modules/mappers/mod_userdir.c line=131 column=44
c
md-> : enter=0, leave=0
-
>pool : include/http_config.h line=291 column=17
p
ool, &usernames : modules/mappers/mod_userdir.c line=136 column=17
u
sernames);
182        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(usertable : modules/mappers/mod_userdir.c line=138 column=18
u
sertable, username : modules/mappers/mod_userdir.c line=135 column=11
u
sername, kw : modules/mappers/mod_userdir.c line=137 column=11
k
w);
183    }
184    return : pass=0
r
eturn NULL;
185}
186
187static const command_rec userdir_cmds[] = {
188    AP_INIT_RAW_ARGS("UserDir", set_user_dir : modules/mappers/mod_userdir.c line=131 column=20
s
et_user_dir, NULL, RSRC_CONF,
189                     "the public subdirectory in users' home directories, or "
190                     "'disabled', or 'disabled username username...', or "
191                     "'enabled username username...'"),
192    {NULL}
193};
194
195static int translate_userdir : call=0
t
ranslate_userdir(request_rec *r)
196{
197    ap_conf_vector_t *server_conf;
198    const userdir_config *s_cfg;
199    char *name = r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>uri : include/httpd.h line=946 column=11
u
ri;
200    const char *userdirs;
201    const char *w, *dname;
202    char *redirect;
203    apr_finfo_t statbuf;
204
205    /*
206     * If the URI doesn't match our basic pattern, we've nothing to do with
207     * it.
208     */
209    if : true=0, false=0
i
f (name : modules/mappers/mod_userdir.c line=199 column=11
n
ame[] : enter=0, leave=0
[
0] != : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
= '/' || : true=0, false=0
|
name : modules/mappers/mod_userdir.c line=199 column=11
n
ame[] : enter=0, leave=0
[
1] != : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
= '~') {
210        return : pass=0
r
eturn DECLINED;
211    }
212    server_conf : modules/mappers/mod_userdir.c line=197 column=23
s
erver_conf = : pass=0
=
 r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>server : include/httpd.h line=784 column=17
s
erver-> : enter=0, leave=0
-
>module_config : include/httpd.h line=1207 column=30
m
odule_config;
213    s_cfg : modules/mappers/mod_userdir.c line=198 column=27
s
_cfg = : pass=0
=
 ap_get_module_config(server_conf : modules/mappers/mod_userdir.c line=197 column=23
s
erver_conf, &userdir_module : modules/mappers/mod_userdir.c line=88 column=31
u
serdir_module);
214    userdirs : modules/mappers/mod_userdir.c line=200 column=17
u
serdirs = : pass=0
=
 s_cfg : modules/mappers/mod_userdir.c line=198 column=27
s
_cfg-> : enter=0, leave=0
-
>userdir : modules/mappers/mod_userdir.c line=92 column=11
u
serdir;
215    if : true=0, false=0
i
f (userdirs : modules/mappers/mod_userdir.c line=200 column=17
u
serdirs == : true=0, false=0
=
= NULL) {
216        return : pass=0
r
eturn DECLINED;
217    }
218
219    dname : modules/mappers/mod_userdir.c line=201 column=21
d
name = : pass=0
=
 name : modules/mappers/mod_userdir.c line=199 column=11
n
ame + : pass=0
+
 2;
220    w : modules/mappers/mod_userdir.c line=201 column=17
w
 = : pass=0
=
 ap_getword : enter=0, leave=0

ap_getword : include/httpd.h line=1299 column=20
a
p_getword(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, &dname : modules/mappers/mod_userdir.c line=201 column=21
d
name, '/');
221
222    /*
223     * The 'dname' funny business involves backing it up to capture the '/'
224     * delimiting the "/~user" part from the rest of the URL, in case there
225     * was one (the case where there wasn't being just "GET /~user HTTP/1.0",
226     * for which we don't want to tack on a '/' onto the filename).
227     */
228
229    if : true=0, false=0
i
f (dname : modules/mappers/mod_userdir.c line=201 column=21
d
name[] : enter=0, leave=0
[
-1] == : true=0, false=0
=
= '/') {
230        -- : pass=0
-
-dname : modules/mappers/mod_userdir.c line=201 column=21
d
name;
231    }
232
233    /*
234     * If there's no username, it's not for us.  Ignore . and .. as well.
235     */
236    if : true=0, false=0
i
f (w : modules/mappers/mod_userdir.c line=201 column=17
w
[] : enter=0, leave=0
[
0] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '\0' || : true=0, false=0
|
| (w : modules/mappers/mod_userdir.c line=201 column=17
w
[] : enter=0, leave=0
[
1] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '.' && : true=0, false=0
&
& (w : modules/mappers/mod_userdir.c line=201 column=17
w
[] : enter=0, leave=0
[
2] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '\0' || : true=0, false=0
|
| (w : modules/mappers/mod_userdir.c line=201 column=17
w
[] : enter=0, leave=0
[
2] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '.' && : true=0, false=0
&
w : modules/mappers/mod_userdir.c line=201 column=17
w
[] : enter=0, leave=0
[
3] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '\0')))) {
237        return : pass=0
r
eturn DECLINED;
238    }
239    /*
240     * Nor if there's an username but it's in the disabled list.
241     */
242    if : true=0, false=0
i
f (apr_table_get : enter=0, leave=0

apr_table_get : /usr/include/apr-1/apr_tables.h line=258 column=27
a
pr_table_get(s_cfg : modules/mappers/mod_userdir.c line=198 column=27
s
_cfg-> : enter=0, leave=0
-
>disabled_users : modules/mappers/mod_userdir.c line=94 column=18
d
isabled_users, w : modules/mappers/mod_userdir.c line=201 column=17
w
!= : true=0, false=0
!
= NULL) {
243        return : pass=0
r
eturn DECLINED;
244    }
245    /*
246     * If there's a global interdiction on UserDirs, check to see if this
247     * name is one of the Blessed.
248     */
249    if : true=0, false=0
i
f (s_cfg : modules/mappers/mod_userdir.c line=198 column=27
s
_cfg-> : enter=0, leave=0
-
>globally_disabled : modules/mappers/mod_userdir.c line=91 column=9
g
lobally_disabled == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= O_DISABLE
250        && : true=0, false=0
&
apr_table_get : enter=0, leave=0

apr_table_get : /usr/include/apr-1/apr_tables.h line=258 column=27
a
pr_table_get(s_cfg : modules/mappers/mod_userdir.c line=198 column=27
s
_cfg-> : enter=0, leave=0
-
>enabled_users : modules/mappers/mod_userdir.c line=93 column=18
e
nabled_users, w : modules/mappers/mod_userdir.c line=201 column=17
w
== : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= NULL) {
251        return : pass=0
r
eturn DECLINED;
252    }
253
254    /*
255     * Special cases all checked, onward to normal substitution processing.
256     */
257
258    while : true=0, false=0
w
hile (* dereference : enter=0, leave=0
*
userdirs : modules/mappers/mod_userdir.c line=200 column=17
u
serdirs) {
259        const char *userdir = ap_getword_conf : enter=0, leave=0

ap_getword_conf : include/httpd.h line=1358 column=20
a
p_getword_conf(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, &userdirs : modules/mappers/mod_userdir.c line=200 column=17
u
serdirs);
260        char *filename = NULL, *x = NULL;
261        apr_status_t rv;
262        int is_absolute = ap_os_is_path_absolute : enter=0, leave=0

ap_os_is_path_absolute : include/httpd.h line=1610 column=17
a
p_os_is_path_absolute(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, userdir : modules/mappers/mod_userdir.c line=259 column=21
u
serdir);
263
264        if : true=0, false=0
i
f (ap_strchr_c(userdir : modules/mappers/mod_userdir.c line=259 column=21
u
serdir, '*'))
265            x : modules/mappers/mod_userdir.c line=260 column=33
x
 = : pass=0
=
 ap_getword : enter=0, leave=0

ap_getword : include/httpd.h line=1299 column=20
a
p_getword(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, &userdir : modules/mappers/mod_userdir.c line=259 column=21
u
serdir, '*');
266
267        if : true=0, false=0
i
f (userdir : modules/mappers/mod_userdir.c line=259 column=21
u
serdir[] : enter=0, leave=0
[
0] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= '\0' || : true=0, false=0
|
MC/DC independently affect : true=0, false=0

is_absolute : modules/mappers/mod_userdir.c line=262 column=13
iTF
s_absolute) {
268            if : true=0, false=0
i
f (x : modules/mappers/mod_userdir.c line=260 column=33
x
) {
269#ifdef HAVE_DRIVE_LETTERS
270                /*
271                 * Crummy hack. Need to figure out whether we have been
272                 * redirected to a URL or to a file on some drive. Since I
273                 * know of no protocols that are a single letter, ignore
274                 * a : as the first or second character, and assume a file
275                 * was specified
276                 */
277                if (strchr(x + 2, ':'))
278#else
279                if : true=0, false=0
i
f (MC/DC independently affect : true=0, false=0
strchr : enter=0, leave=0

strchr : /usr/include/string.h line=235 column=14
sTF
trchr(x : modules/mappers/mod_userdir.c line=260 column=33
x
, ':') && : true=0, false=0
&
! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
is_absolute : modules/mappers/mod_userdir.c line=262 column=13
i
s_absolute)
280#endif /* HAVE_DRIVE_LETTERS */
281                {
282                    redirect : modules/mappers/mod_userdir.c line=202 column=11
r
edirect = : pass=0
=
 apr_pstrcat : enter=0, leave=0

apr_pstrcat : /usr/include/apr-1/apr_strings.h line=139 column=28
a
pr_pstrcat(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, x : modules/mappers/mod_userdir.c line=260 column=33
x
w : modules/mappers/mod_userdir.c line=201 column=17
w
userdir : modules/mappers/mod_userdir.c line=259 column=21
u
serdir, dname : modules/mappers/mod_userdir.c line=201 column=21
d
name, NULL);
283                    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(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>headers_out : include/httpd.h line=903 column=18
h
eaders_out, "Location", redirect : modules/mappers/mod_userdir.c line=202 column=11
r
edirect);
284                    return : pass=0
r
eturn HTTP_MOVED_TEMPORARILY;
285                }
286                else
287                    filename : modules/mappers/mod_userdir.c line=260 column=15
f
ilename = : pass=0
=
 apr_pstrcat : enter=0, leave=0

apr_pstrcat : /usr/include/apr-1/apr_strings.h line=139 column=28
a
pr_pstrcat(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, x : modules/mappers/mod_userdir.c line=260 column=33
x
w : modules/mappers/mod_userdir.c line=201 column=17
w
userdir : modules/mappers/mod_userdir.c line=259 column=21
u
serdir, NULL);
288            }
289            else
290                filename : modules/mappers/mod_userdir.c line=260 column=15
f
ilename = : pass=0
=
 apr_pstrcat : enter=0, leave=0

apr_pstrcat : /usr/include/apr-1/apr_strings.h line=139 column=28
a
pr_pstrcat(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, userdir : modules/mappers/mod_userdir.c line=259 column=21
u
serdir, "/", w : modules/mappers/mod_userdir.c line=201 column=17
w
, NULL);
291        }
292        else if : true=0, false=0
i
f (MC/DC independently affect : true=0, false=0

x : modules/mappers/mod_userdir.c line=260 column=33
xTF
 && : true=0, false=0
&
& ap_strchr_c(x : modules/mappers/mod_userdir.c line=260 column=33
x
, ':')) {
293            redirect : modules/mappers/mod_userdir.c line=202 column=11
r
edirect = : pass=0
=
 apr_pstrcat : enter=0, leave=0

apr_pstrcat : /usr/include/apr-1/apr_strings.h line=139 column=28
a
pr_pstrcat(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, x : modules/mappers/mod_userdir.c line=260 column=33
x
w : modules/mappers/mod_userdir.c line=201 column=17
w
dname : modules/mappers/mod_userdir.c line=201 column=21
d
name, NULL);
294            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(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>headers_out : include/httpd.h line=903 column=18
h
eaders_out, "Location", redirect : modules/mappers/mod_userdir.c line=202 column=11
r
edirect);
295            return : pass=0
r
eturn HTTP_MOVED_TEMPORARILY;
296        }
297        else {
298#if APR_HAS_USER
299            char *homedir;
300
301            if : true=0, false=0
i
f (apr_uid_homepath_get : enter=0, leave=0

apr_uid_homepath_get : /usr/include/apr-1/apr_user.h line=98 column=27
a
pr_uid_homepath_get(&homedir : modules/mappers/mod_userdir.c line=299 column=19
h
omedir, w : modules/mappers/mod_userdir.c line=201 column=17
w
r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool) == : true=0, false=0
=
= APR_SUCCESS) {
302                filename : modules/mappers/mod_userdir.c line=260 column=15
f
ilename = : pass=0
=
 apr_pstrcat : enter=0, leave=0

apr_pstrcat : /usr/include/apr-1/apr_strings.h line=139 column=28
a
pr_pstrcat(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, homedir : modules/mappers/mod_userdir.c line=299 column=19
h
omedir, "/", userdir : modules/mappers/mod_userdir.c line=259 column=21
u
serdir, NULL);
303            }
304#else
305            return DECLINED;
306#endif
307        }
308
309        /*
310         * Now see if it exists, or we're at the last entry. If we are at the
311         * last entry, then use the filename generated (if there is one)
312         * anyway, in the hope that some handler might handle it. This can be
313         * used, for example, to run a CGI script for the user.
314         */
315        if : true=0, false=0
i
f (MC/DC independently affect : true=0, false=0

filename : modules/mappers/mod_userdir.c line=260 column=15
fTF
ilename && : true=0, false=0
&
& (! : true=0, false=0
MC/DC independently affect : true=0, false=0
!TF
* dereference : enter=0, leave=0
*
userdirs : modules/mappers/mod_userdir.c line=200 column=17
u
serdirs
316                      || : true=0, false=0
|
| ((rv : modules/mappers/mod_userdir.c line=261 column=22
r
= : pass=0
=
 apr_stat : enter=0, leave=0

apr_stat : /usr/include/apr-1/apr_file_info.h line=229 column=27
a
pr_stat(&statbuf : modules/mappers/mod_userdir.c line=203 column=17
s
tatbuf, filename : modules/mappers/mod_userdir.c line=260 column=15
f
ilename, APR_FINFO_MIN,
317                                         r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool)) == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= APR_SUCCESS
318                                             || : true=0, false=0
|
rv : modules/mappers/mod_userdir.c line=261 column=22
r
== : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= APR_INCOMPLETE))) {
319            r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>filename : include/httpd.h line=948 column=11
f
ilename = : enter=0, leave=0
=
 apr_pstrcat : enter=0, leave=0

apr_pstrcat : /usr/include/apr-1/apr_strings.h line=139 column=28
a
pr_pstrcat(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, filename : modules/mappers/mod_userdir.c line=260 column=15
f
ilename, dname : modules/mappers/mod_userdir.c line=201 column=21
d
name, NULL);
320            /* XXX: Does this walk us around FollowSymLink rules?
321             * When statbuf contains info on r->filename we can save a syscall
322             * by copying it to r->finfo
323             */
324            if : true=0, false=0
i
f (MC/DC independently affect : true=0, false=0
* dereference : enter=0, leave=0
*TF
userdirs : modules/mappers/mod_userdir.c line=200 column=17
u
serdirs && : true=0, false=0
&
dname : modules/mappers/mod_userdir.c line=201 column=21
d
name[] : enter=0, leave=0
[
0] == : true=0, false=0
MC/DC independently affect : true=0, false=0
=TF
= 0)
325                r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>finfo : include/httpd.h line=957 column=17
f
info = : enter=0, leave=0
=
 statbuf : modules/mappers/mod_userdir.c line=203 column=17
s
tatbuf;
326
327            /* For use in the get_suexec_identity phase */
328            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(r : modules/mappers/mod_userdir.c line=195 column=43
r
-> : enter=0, leave=0
-
>notes : include/httpd.h line=910 column=18
n
otes, "mod_userdir_user", w : modules/mappers/mod_userdir.c line=201 column=17
w
);
329
330            return : pass=0
r
eturn OK;
331        }
332    }
333
334    return : pass=0
r
eturn DECLINED;
335}
336
337#ifdef HAVE_UNIX_SUEXEC
338static ap_unix_identity_t *get_suexec_id_doer : call=0
g
et_suexec_id_doer(const request_rec *r)
339{
340    ap_unix_identity_t *ugid = NULL;
341#if APR_HAS_USER
342    const char *username = apr_table_get : enter=0, leave=0

apr_table_get : /usr/include/apr-1/apr_tables.h line=258 column=27
a
pr_table_get(r : modules/mappers/mod_userdir.c line=338 column=66
r
-> : enter=0, leave=0
-
>notes : include/httpd.h line=910 column=18
n
otes, "mod_userdir_user");
343
344    if : true=0, false=0
i
f (username : modules/mappers/mod_userdir.c line=342 column=17
u
sername == : true=0, false=0
=
= NULL) {
345        return : pass=0
r
eturn NULL;
346    }
347
348    if : true=0, false=0
i
f ((ugid : modules/mappers/mod_userdir.c line=340 column=25
u
gid = : pass=0
=
 apr_palloc : enter=0, leave=0

apr_palloc : /usr/include/apr-1/apr_pools.h line=419 column=21
a
pr_palloc(r : modules/mappers/mod_userdir.c line=338 column=66
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool, sizeof(*ugid))) == : true=0, false=0
=
= NULL) {
349        return : pass=0
r
eturn NULL;
350    }
351
352    if : true=0, false=0
i
f (apr_uid_get : enter=0, leave=0

apr_uid_get : /usr/include/apr-1/apr_user.h line=88 column=27
a
pr_uid_get(&ugid : modules/mappers/mod_userdir.c line=340 column=25
u
gid-> : enter=0, leave=0
-
>uid : os/unix/unixd.h line=52 column=11
u
id, &ugid : modules/mappers/mod_userdir.c line=340 column=25
u
gid-> : enter=0, leave=0
-
>gid : os/unix/unixd.h line=53 column=11
g
id, username : modules/mappers/mod_userdir.c line=342 column=17
u
sername, r : modules/mappers/mod_userdir.c line=338 column=66
r
-> : enter=0, leave=0
-
>pool : include/httpd.h line=780 column=17
p
ool) != : true=0, false=0
!
= APR_SUCCESS) {
353        return : pass=0
r
eturn NULL;
354    }
355
356    ugid : modules/mappers/mod_userdir.c line=340 column=25
u
gid-> : enter=0, leave=0
-
>userdir : os/unix/unixd.h line=54 column=9
u
serdir = : enter=0, leave=0
=
 1;
357#endif
358    return : pass=0
r
eturn ugid : modules/mappers/mod_userdir.c line=340 column=25
u
gid;
359}
360#endif /* HAVE_UNIX_SUEXEC */
361
362static void register_hooks : call=1
r
egister_hooks(apr_pool_t *p)
363{
364    static const char * const aszPre[]={ "mod_alias.c",NULL };
365    static const char * const aszSucc[]={ "mod_vhost_alias.c",NULL };
366
367    ap_hook_translate_name : enter=1, leave=1

ap_hook_translate_name : modules/mappers/ line=99 column=1
a
p_hook_translate_name(translate_userdir : modules/mappers/mod_userdir.c line=195 column=12
t
ranslate_userdir,aszPre : modules/mappers/mod_userdir.c line=364 column=31
a
szPre,aszSucc : modules/mappers/mod_userdir.c line=365 column=31
a
szSucc,APR_HOOK_MIDDLE);
368#ifdef HAVE_UNIX_SUEXEC
369    ap_hook_get_suexec_identity : enter=1, leave=1

ap_hook_get_suexec_identity : modules/mappers/ line=81 column=1
a
p_hook_get_suexec_identity(get_suexec_id_doer : modules/mappers/mod_userdir.c line=338 column=28
g
et_suexec_id_doer,NULL,NULL,APR_HOOK_FIRST);
370#endif
371}
372
373module AP_MODULE_DECLARE_DATA userdir_module = {
374    STANDARD20_MODULE_STUFF,
375    NULL,                       /* dir config creater */
376    NULL,                       /* dir merger --- default is to override */
377    create_userdir_config : modules/mappers/mod_userdir.c line=103 column=14
c
reate_userdir_config,      /* server config */
378    merge_userdir_config : modules/mappers/mod_userdir.c line=115 column=14
m
erge_userdir_config,       /* merge server config */
379    userdir_cmds : modules/mappers/mod_userdir.c line=187 column=26
u
serdir_cmds,               /* command apr_table_t */
380    register_hooks : modules/mappers/mod_userdir.c line=362 column=13
r
egister_hooks              /* register hooks */
381};
382[EOF]


Generated by expcov