All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Derrick Stolee via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, johannes.schindelin@gmx.de,
	"Jeff King" <peff@peff.net>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Derrick Stolee" <derrickstolee@github.com>,
	"Derrick Stolee" <derrickstolee@github.com>
Subject: [PATCH v2 3/3] *: avoid "whitelist"
Date: Fri, 15 Jul 2022 02:38:42 +0000	[thread overview]
Message-ID: <0d862cbbebe1a9f47f72255217faf734b1db4055.1657852722.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1274.v2.git.1657852722.gitgitgadget@gmail.com>

From: Derrick Stolee <derrickstolee@github.com>

The word "whitelist" has cultural implications that are not inclusive.
Thankfully, it is not difficult to reword and avoid its use.

A previous change already modified the documentation for git-cvsserver
and git-daemon to refer to a directory list. It is simple to update the
comments and error messages here to refer to that directory list.

In the case of transport.c, the GIT_ALLOW_PROTOCOL environment variable
was referred to as a "whitelist", but the word "allow" is already part
of the variable. Replace "whitelist" with "allow_list" in these cases to
demonstrate that we are processing a list of allowed protocols.

After this change, the only remaining uses of "whitelist" and its
companion "blacklist" are in release notes for older versions of Git and
in the sha1dc project, which is maintained independently.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
---
 daemon.c           | 8 ++++----
 git-cvsserver.perl | 2 +-
 transport.c        | 8 ++++----
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/daemon.c b/daemon.c
index 58f1077885c..e0706efc652 100644
--- a/daemon.c
+++ b/daemon.c
@@ -279,7 +279,7 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)
 		/* The validation is done on the paths after enter_repo
 		 * appends optional {.git,.git/.git} and friends, but
 		 * it does not use getcwd().  So if your /pub is
-		 * a symlink to /mnt/pub, you can whitelist /pub and
+		 * a symlink to /mnt/pub, you can include /pub and
 		 * do not have to say /mnt/pub.
 		 * Do not say /pub/.
 		 */
@@ -298,7 +298,7 @@ static const char *path_ok(const char *directory, struct hostinfo *hi)
 			return path;
 	}
 
-	logerror("'%s': not in whitelist", path);
+	logerror("'%s': not in directory list", path);
 	return NULL;		/* Fallthrough. Deny by default */
 }
 
@@ -403,7 +403,7 @@ static int run_service(const char *dir, struct daemon_service *service,
 	 * a "git-daemon-export-ok" flag that says that the other side
 	 * is ok with us doing this.
 	 *
-	 * path_ok() uses enter_repo() and does whitelist checking.
+	 * path_ok() uses enter_repo() and checks for included directories.
 	 * We only need to make sure the repository is exported.
 	 */
 
@@ -1444,7 +1444,7 @@ int cmd_main(int argc, const char **argv)
 		cred = prepare_credentials(user_name, group_name);
 
 	if (strict_paths && (!ok_paths || !*ok_paths))
-		die("option --strict-paths requires a whitelist");
+		die("option --strict-paths requires a directory list");
 
 	if (base_path && !is_directory(base_path))
 		die("base-path '%s' does not exist or is not a directory",
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 4c8118010a8..ec64f06af7c 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -152,7 +152,7 @@ $state->{allowed_roots} = [ @ARGV ];
 
 # don't export the whole system unless the users requests it
 if ($state->{'export-all'} && !@{$state->{allowed_roots}}) {
-    die "--export-all can only be used together with an explicit whitelist\n";
+    die "--export-all can only be used together with an explicit directory list\n";
 }
 
 # Environment handling for running under git-shell
diff --git a/transport.c b/transport.c
index 52db7a3cb09..b51e991e443 100644
--- a/transport.c
+++ b/transport.c
@@ -940,7 +940,7 @@ static int external_specification_len(const char *url)
 	return strchr(url, ':') - url;
 }
 
-static const struct string_list *protocol_whitelist(void)
+static const struct string_list *protocol_allow_list(void)
 {
 	static int enabled = -1;
 	static struct string_list allowed = STRING_LIST_INIT_DUP;
@@ -1020,9 +1020,9 @@ static enum protocol_allow_config get_protocol_config(const char *type)
 
 int is_transport_allowed(const char *type, int from_user)
 {
-	const struct string_list *whitelist = protocol_whitelist();
-	if (whitelist)
-		return string_list_has_string(whitelist, type);
+	const struct string_list *allow_list = protocol_allow_list();
+	if (allow_list)
+		return string_list_has_string(allow_list, type);
 
 	switch (get_protocol_config(type)) {
 	case PROTOCOL_ALLOW_ALWAYS:
-- 
gitgitgadget

  parent reply	other threads:[~2022-07-15  2:38 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-13 13:20 [PATCH 0/3] Use "allowlist" and "denylist" tree-wide Derrick Stolee via GitGitGadget
2022-07-13 13:20 ` [PATCH 1/3] Documentation: use allowlist and denylist Derrick Stolee via GitGitGadget
2022-07-13 15:21   ` Jeff King
2022-07-13 18:34     ` Derrick Stolee
2022-07-13 20:20   ` Junio C Hamano
2022-07-13 13:20 ` [PATCH 2/3] t/*: use allowlist Derrick Stolee via GitGitGadget
2022-07-13 13:20 ` [PATCH 3/3] *: use allowlist and denylist Derrick Stolee via GitGitGadget
2022-07-13 13:27   ` Johannes Schindelin
2022-07-13 15:23   ` Jeff King
2022-07-13 13:29 ` [PATCH 0/3] Use "allowlist" and "denylist" tree-wide Johannes Schindelin
2022-07-13 16:18 ` Junio C Hamano
2022-07-13 18:33   ` Derrick Stolee
2022-07-13 20:32     ` Junio C Hamano
2022-07-13 19:42 ` Ævar Arnfjörð Bjarmason
2022-07-13 22:28   ` Junio C Hamano
2022-07-15  2:25     ` Derrick Stolee
2022-07-13 20:02 ` Ævar Arnfjörð Bjarmason
2022-07-15  2:38 ` [PATCH v2 0/3] Remove use of "whitelist" Derrick Stolee via GitGitGadget
2022-07-15  2:38   ` [PATCH v2 1/3] Documentation: remove use of whitelist Derrick Stolee via GitGitGadget
2022-07-15 10:47     ` Ævar Arnfjörð Bjarmason
2022-07-19 14:21       ` Derrick Stolee
2022-07-15  2:38   ` [PATCH v2 2/3] t/*: avoid "whitelist" Derrick Stolee via GitGitGadget
2022-07-15 11:02     ` Ævar Arnfjörð Bjarmason
2022-07-19 15:09       ` Derrick Stolee
2022-07-19 15:26         ` Ævar Arnfjörð Bjarmason
2022-07-19 15:42           ` Derrick Stolee
2022-07-19 19:44         ` Junio C Hamano
2022-07-15  2:38   ` Derrick Stolee via GitGitGadget [this message]
2022-07-15 11:19     ` [PATCH v2 3/3] *: " Ævar Arnfjörð Bjarmason
2022-07-15  6:30   ` [PATCH v2 0/3] Remove use of "whitelist" Junio C Hamano
2022-07-15 16:16     ` Phillip Wood
2022-07-19 18:32   ` [PATCH v3 0/5] " Derrick Stolee via GitGitGadget
2022-07-19 18:32     ` [PATCH v3 1/5] daemon: clarify directory arguments Derrick Stolee via GitGitGadget
2022-07-19 18:32     ` [PATCH v3 2/5] git-cvsserver: clarify directory list Derrick Stolee via GitGitGadget
2022-07-19 18:32     ` [PATCH v3 3/5] git.txt: remove redundant language Derrick Stolee via GitGitGadget
2022-07-31  0:35       ` Jeff King
2022-07-19 18:32     ` [PATCH v3 4/5] t: avoid "whitelist" Derrick Stolee via GitGitGadget
2022-07-19 18:32     ` [PATCH v3 5/5] transport.c: " Derrick Stolee via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d862cbbebe1a9f47f72255217faf734b1db4055.1657852722.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=avarab@gmail.com \
    --cc=derrickstolee@github.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=johannes.schindelin@gmx.de \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.