diff --git a/src/backend/distributed/commands/utility_hook.c b/src/backend/distributed/commands/utility_hook.c index 50bfdbe3b..682c08240 100644 --- a/src/backend/distributed/commands/utility_hook.c +++ b/src/backend/distributed/commands/utility_hook.c @@ -285,7 +285,7 @@ multi_ProcessUtility(PlannedStmt *pstmt, return; } - /* process SET LOCAL stmts of whitelisted GUCs in multi-stmt xacts */ + /* process SET LOCAL stmts of allowed GUCs in multi-stmt xacts */ if (IsA(parsetree, VariableSetStmt)) { VariableSetStmt *setStmt = (VariableSetStmt *) parsetree; diff --git a/src/backend/distributed/connection/connection_configuration.c b/src/backend/distributed/connection/connection_configuration.c index 0e461b36e..38225bc2a 100644 --- a/src/backend/distributed/connection/connection_configuration.c +++ b/src/backend/distributed/connection/connection_configuration.c @@ -122,18 +122,18 @@ AddConnParam(const char *keyword, const char *value) * * - Not use a uri-prefix such as postgres:// (it must be only keys and values) * - Parse using PQconninfoParse - * - Only set keywords contained in the provided whitelist + * - Only set keywords contained in the provided allowedConninfoKeywords * * This function returns true if all of the above are satisfied, otherwise it * returns false. If the provided errmsg pointer is not NULL, it will be set * to an appropriate message if the check fails. * - * The provided whitelist must be sorted in a manner usable by bsearch, though - * this is only validated during assert-enabled builds. + * The provided allowedConninfoKeywords must be sorted in a manner usable by bsearch, + * though this is only validated during assert-enabled builds. */ bool -CheckConninfo(const char *conninfo, const char **whitelist, - Size whitelistLength, char **errorMsg) +CheckConninfo(const char *conninfo, const char **allowedConninfoKeywords, + Size allowedConninfoKeywordsLength, char **errorMsg) { PQconninfoOption *option = NULL; char *errorMsgString = NULL; @@ -173,11 +173,11 @@ CheckConninfo(const char *conninfo, const char **whitelist, #ifdef USE_ASSERT_CHECKING - /* verify that the whitelist is in ascending order */ - for (Size whitelistIdx = 1; whitelistIdx < whitelistLength; whitelistIdx++) + /* verify that the allowedConninfoKeywords is in ascending order */ + for (Size keywordIdx = 1; keywordIdx < allowedConninfoKeywordsLength; keywordIdx++) { - const char *prev = whitelist[whitelistIdx - 1]; - const char *curr = whitelist[whitelistIdx]; + const char *prev = allowedConninfoKeywords[keywordIdx - 1]; + const char *curr = allowedConninfoKeywords[keywordIdx]; AssertArg(strcmp(prev, curr) < 0); } @@ -190,11 +190,12 @@ CheckConninfo(const char *conninfo, const char **whitelist, continue; } - void *matchingKeyword = SafeBsearch(&option->keyword, whitelist, whitelistLength, - sizeof(char *), pg_qsort_strcmp); + void *matchingKeyword = SafeBsearch(&option->keyword, allowedConninfoKeywords, + allowedConninfoKeywordsLength, sizeof(char *), + pg_qsort_strcmp); if (matchingKeyword == NULL) { - /* the whitelist lacks this keyword; error out! */ + /* the allowedConninfoKeywords lacks this keyword; error out! */ StringInfoData msgString; initStringInfo(&msgString); diff --git a/src/backend/distributed/shared_library_init.c b/src/backend/distributed/shared_library_init.c index e4cd7b789..706795b00 100644 --- a/src/backend/distributed/shared_library_init.c +++ b/src/backend/distributed/shared_library_init.c @@ -1516,14 +1516,14 @@ WarnIfDeprecatedExecutorUsed(int *newval, void **extra, GucSource source) /* * NodeConninfoGucCheckHook ensures conninfo settings are in the expected form - * and that the keywords of all non-null settings are on a whitelist devised to + * and that the keywords of all non-null settings are on a allowlist devised to * keep users from setting options that may result in confusion. */ static bool NodeConninfoGucCheckHook(char **newval, void **extra, GucSource source) { /* this array _must_ be kept in an order usable by bsearch */ - const char *whitelist[] = { + const char *allowedConninfoKeywords[] = { "application_name", "connect_timeout", #if defined(ENABLE_GSS) && defined(ENABLE_SSPI) @@ -1542,8 +1542,8 @@ NodeConninfoGucCheckHook(char **newval, void **extra, GucSource source) "sslrootcert" }; char *errorMsg = NULL; - bool conninfoValid = CheckConninfo(*newval, whitelist, lengthof(whitelist), - &errorMsg); + bool conninfoValid = CheckConninfo(*newval, allowedConninfoKeywords, + lengthof(allowedConninfoKeywords), &errorMsg); if (!conninfoValid) { diff --git a/src/include/distributed/connection_management.h b/src/include/distributed/connection_management.h index 6806333a0..21043bfb0 100644 --- a/src/include/distributed/connection_management.h +++ b/src/include/distributed/connection_management.h @@ -213,8 +213,8 @@ extern void AddConnParam(const char *keyword, const char *value); extern void GetConnParams(ConnectionHashKey *key, char ***keywords, char ***values, Index *runtimeParamStart, MemoryContext context); extern const char * GetConnParam(const char *keyword); -extern bool CheckConninfo(const char *conninfo, const char **whitelist, - Size whitelistLength, char **errmsg); +extern bool CheckConninfo(const char *conninfo, const char **allowedConninfoKeywords, + Size allowedConninfoKeywordsLength, char **errmsg); /* Low-level connection establishment APIs */