Skip to content

Commit ef7b9ad

Browse files
committed
Merge branch 'ds/doc-wo-whitelist' into maint
Avoid "white/black-list" in documentation and code comments. source: <[email protected]> * ds/doc-wo-whitelist: transport.c: avoid "whitelist" t: avoid "whitelist" git.txt: remove redundant language git-cvsserver: clarify directory list daemon: clarify directory arguments
2 parents d169785 + f5adaa5 commit ef7b9ad

11 files changed

+39
-40
lines changed

Documentation/git-cvsserver.txt

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,10 @@ Print version information and exit
6363
Print usage information and exit
6464

6565
<directory>::
66-
You can specify a list of allowed directories. If no directories
67-
are given, all are allowed. This is an additional restriction, gitcvs
68-
access still needs to be enabled by the `gitcvs.enabled` config option
69-
unless `--export-all` was given, too.
70-
66+
The remaining arguments provide a list of directories. If no directories
67+
are given, then all are allowed. Repositories within these directories
68+
still require the `gitcvs.enabled` config option, unless `--export-all`
69+
is specified.
7170

7271
LIMITATIONS
7372
-----------
@@ -311,11 +310,13 @@ ENVIRONMENT
311310
These variables obviate the need for command-line options in some
312311
circumstances, allowing easier restricted usage through git-shell.
313312

314-
GIT_CVSSERVER_BASE_PATH takes the place of the argument to --base-path.
313+
GIT_CVSSERVER_BASE_PATH::
314+
This variable replaces the argument to --base-path.
315315

316-
GIT_CVSSERVER_ROOT specifies a single-directory whitelist. The
317-
repository must still be configured to allow access through
318-
git-cvsserver, as described above.
316+
GIT_CVSSERVER_ROOT::
317+
This variable specifies a single directory, replacing the
318+
`<directory>...` argument list. The repository still requires the
319+
`gitcvs.enabled` config option, unless `--export-all` is specified.
319320

320321
When these environment variables are set, the corresponding
321322
command-line arguments may not be used.

Documentation/git-daemon.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ that service if it is enabled.
3232
It verifies that the directory has the magic file "git-daemon-export-ok", and
3333
it will refuse to export any Git directory that hasn't explicitly been marked
3434
for export this way (unless the `--export-all` parameter is specified). If you
35-
pass some directory paths as 'git daemon' arguments, you can further restrict
36-
the offers to a whitelist comprising of those.
35+
pass some directory paths as 'git daemon' arguments, the offers are limited to
36+
repositories within those directories.
3737

3838
By default, only `upload-pack` service is enabled, which serves
3939
'git fetch-pack' and 'git ls-remote' clients, which are invoked
@@ -50,7 +50,7 @@ OPTIONS
5050
Match paths exactly (i.e. don't allow "/foo/repo" when the real path is
5151
"/foo/repo.git" or "/foo/repo/.git") and don't do user-relative paths.
5252
'git daemon' will refuse to start when this option is enabled and no
53-
whitelist is specified.
53+
directory arguments are provided.
5454

5555
--base-path=<path>::
5656
Remap all the path requests as relative to the given path.
@@ -73,7 +73,7 @@ OPTIONS
7373
%IP for the server's IP address, %P for the port number,
7474
and %D for the absolute path of the named repository.
7575
After interpolation, the path is validated against the directory
76-
whitelist.
76+
list.
7777

7878
--export-all::
7979
Allow pulling from all directories that look like Git repositories
@@ -218,9 +218,11 @@ standard output to be sent to the requestor as an error message when
218218
it declines the service.
219219

220220
<directory>::
221-
A directory to add to the whitelist of allowed directories. Unless
222-
--strict-paths is specified this will also include subdirectories
223-
of each named directory.
221+
The remaining arguments provide a list of directories. If any
222+
directories are specified, then the `git-daemon` process will
223+
serve a requested directory only if it is contained in one of
224+
these directories. If `--strict-paths` is specified, then the
225+
requested directory must match one of these directories exactly.
224226

225227
SERVICES
226228
--------
@@ -264,9 +266,8 @@ git 9418/tcp # Git Version Control System
264266

265267
'git daemon' as inetd server::
266268
To set up 'git daemon' as an inetd service that handles any
267-
repository under the whitelisted set of directories, /pub/foo
268-
and /pub/bar, place an entry like the following into
269-
/etc/inetd all on one line:
269+
repository within `/pub/foo` or `/pub/bar`, place an entry like
270+
the following into `/etc/inetd` all on one line:
270271
+
271272
------------------------------------------------
272273
git stream tcp nowait nobody /usr/bin/git

Documentation/git.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -885,9 +885,7 @@ for full details.
885885
If set to a colon-separated list of protocols, behave as if
886886
`protocol.allow` is set to `never`, and each of the listed
887887
protocols has `protocol.<name>.allow` set to `always`
888-
(overriding any existing configuration). In other words, any
889-
protocol not mentioned will be disallowed (i.e., this is a
890-
whitelist, not a blacklist). See the description of
888+
(overriding any existing configuration). See the description of
891889
`protocol.allow` in linkgit:git-config[1] for more details.
892890

893891
`GIT_PROTOCOL_FROM_USER`::

daemon.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)
279279
/* The validation is done on the paths after enter_repo
280280
* appends optional {.git,.git/.git} and friends, but
281281
* it does not use getcwd(). So if your /pub is
282-
* a symlink to /mnt/pub, you can whitelist /pub and
282+
* a symlink to /mnt/pub, you can include /pub and
283283
* do not have to say /mnt/pub.
284284
* Do not say /pub/.
285285
*/
@@ -298,7 +298,7 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)
298298
return path;
299299
}
300300

301-
logerror("'%s': not in whitelist", path);
301+
logerror("'%s': not in directory list", path);
302302
return NULL; /* Fallthrough. Deny by default */
303303
}
304304

@@ -403,7 +403,7 @@ static int run_service(const char *dir, struct daemon_service *service,
403403
* a "git-daemon-export-ok" flag that says that the other side
404404
* is ok with us doing this.
405405
*
406-
* path_ok() uses enter_repo() and does whitelist checking.
406+
* path_ok() uses enter_repo() and checks for included directories.
407407
* We only need to make sure the repository is exported.
408408
*/
409409

@@ -1444,7 +1444,7 @@ int cmd_main(int argc, const char **argv)
14441444
cred = prepare_credentials(user_name, group_name);
14451445

14461446
if (strict_paths && (!ok_paths || !*ok_paths))
1447-
die("option --strict-paths requires a whitelist");
1447+
die("option --strict-paths requires '<directory>' arguments");
14481448

14491449
if (base_path && !is_directory(base_path))
14501450
die("base-path '%s' does not exist or is not a directory",

git-cvsserver.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152

153153
# don't export the whole system unless the users requests it
154154
if ($state->{'export-all'} && !@{$state->{allowed_roots}}) {
155-
die "--export-all can only be used together with an explicit whitelist\n";
155+
die "--export-all can only be used together with an explicit '<directory>...' list\n";
156156
}
157157

158158
# Environment handling for running under git-shell

t/lib-proto-disable.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Test routines for checking protocol disabling.
22

3-
# Test clone/fetch/push with GIT_ALLOW_PROTOCOL whitelist
4-
test_whitelist () {
3+
# Test clone/fetch/push with GIT_ALLOW_PROTOCOL environment variable
4+
test_allow_var () {
55
desc=$1
66
proto=$2
77
url=$3
@@ -183,7 +183,7 @@ test_config () {
183183
# $2 - machine-readable name of the protocol
184184
# $3 - the URL to try cloning
185185
test_proto () {
186-
test_whitelist "$@"
186+
test_allow_var "$@"
187187

188188
test_config "$@"
189189
}

t/t5812-proto-disable-http.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ test_expect_success 'create git-accessible repo' '
1616

1717
test_proto "smart http" http "$HTTPD_URL/smart/repo.git"
1818

19-
test_expect_success 'curl redirects respect whitelist' '
19+
test_expect_success 'http(s) transport respects GIT_ALLOW_PROTOCOL' '
2020
test_must_fail env GIT_ALLOW_PROTOCOL=http:https \
2121
GIT_SMART_HTTP=0 \
2222
git clone "$HTTPD_URL/ftp-redir/repo.git" 2>stderr &&

t/t5815-submodule-protos.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
test_description='test protocol whitelisting with submodules'
3+
test_description='test protocol filtering with submodules'
44
. ./test-lib.sh
55
. "$TEST_DIRECTORY"/lib-proto-disable.sh
66

@@ -36,7 +36,7 @@ test_expect_success 'update of ext not allowed' '
3636
test_must_fail git -C dst submodule update ext-module
3737
'
3838

39-
test_expect_success 'user can override whitelist' '
39+
test_expect_success 'user can filter protocols with GIT_ALLOW_PROTOCOL' '
4040
GIT_ALLOW_PROTOCOL=ext git -C dst submodule update ext-module
4141
'
4242

t/t9400-git-cvsserver-server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ test_expect_success 'req_Root (export-all)' \
221221
'cat request-anonymous | git-cvsserver --export-all pserver "$WORKDIR" >log 2>&1 &&
222222
sed -ne \$p log | grep "^I LOVE YOU\$"'
223223

224-
test_expect_success 'req_Root failure (export-all w/o whitelist)' \
224+
test_expect_success 'req_Root failure (export-all w/o directory list)' \
225225
'! (cat request-anonymous | git-cvsserver --export-all pserver >log 2>&1 || false)'
226226

227227
test_expect_success 'req_Root (everything together)' \

t/test-lib-functions.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,7 @@ test_set_prereq () {
651651
# test_unset_prereq()
652652
!*)
653653
;;
654-
# (Temporary?) whitelist of things we can't easily
655-
# pretend not to support
654+
# List of things we can't easily pretend to not support
656655
SYMLINKS)
657656
;;
658657
# Inspecting whether GIT_TEST_FAIL_PREREQS is on

0 commit comments

Comments
 (0)