зеркало из https://github.com/microsoft/git.git
transport.c: avoid "whitelist"
The word "whitelist" has cultural implications that are not inclusive. Thankfully, it is not difficult to reword and avoid its use. 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. Signed-off-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
0011f94a4f
Коммит
f5adaa5cc3
|
@ -940,7 +940,7 @@ static int external_specification_len(const char *url)
|
||||||
return strchr(url, ':') - 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 int enabled = -1;
|
||||||
static struct string_list allowed = STRING_LIST_INIT_DUP;
|
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)
|
int is_transport_allowed(const char *type, int from_user)
|
||||||
{
|
{
|
||||||
const struct string_list *whitelist = protocol_whitelist();
|
const struct string_list *allow_list = protocol_allow_list();
|
||||||
if (whitelist)
|
if (allow_list)
|
||||||
return string_list_has_string(whitelist, type);
|
return string_list_has_string(allow_list, type);
|
||||||
|
|
||||||
switch (get_protocol_config(type)) {
|
switch (get_protocol_config(type)) {
|
||||||
case PROTOCOL_ALLOW_ALWAYS:
|
case PROTOCOL_ALLOW_ALWAYS:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче