summaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2020-02-07 08:10:40 +0900
committerMichael Paquier <michael@paquier.xyz>2020-02-07 08:10:40 +0900
commit414c2fd1e1c0ccd1af1cad046bef1264e3f4347f (patch)
tree15666167017bbc1dbe4b6b4a7e4aa06ab7f9e935 /src/backend/utils/misc/guc.c
parentfc7a5e9eaa2fa34b053ffe52e0e57f1fd6b1f939 (diff)
Revert "Add GUC checks for ssl_min_protocol_version and ssl_max_protocol_version"
This reverts commit 41aadee, as the GUC checks could run on older values with the new values used, and result in incorrect errors if both parameters are changed at the same time. Per complaint from Tom Lane. Discussion: https://postgr.es/m/27574.1581015893@sss.pgh.pa.us Backpatch-through: 12
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r--src/backend/utils/misc/guc.c51
1 files changed, 2 insertions, 49 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 9630866a5f9..8228e1f3903 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -205,10 +205,6 @@ static const char *show_log_file_mode(void);
static const char *show_data_directory_mode(void);
static bool check_backtrace_functions(char **newval, void **extra, GucSource source);
static void assign_backtrace_functions(const char *newval, void *extra);
-static bool check_ssl_min_protocol_version(int *newval, void **extra,
- GucSource source);
-static bool check_ssl_max_protocol_version(int *newval, void **extra,
- GucSource source);
static bool check_recovery_target_timeline(char **newval, void **extra, GucSource source);
static void assign_recovery_target_timeline(const char *newval, void *extra);
static bool check_recovery_target(char **newval, void **extra, GucSource source);
@@ -4657,7 +4653,7 @@ static struct config_enum ConfigureNamesEnum[] =
&ssl_min_protocol_version,
PG_TLS1_2_VERSION,
ssl_protocol_versions_info + 1, /* don't allow PG_TLS_ANY */
- check_ssl_min_protocol_version, NULL, NULL
+ NULL, NULL, NULL
},
{
@@ -4669,7 +4665,7 @@ static struct config_enum ConfigureNamesEnum[] =
&ssl_max_protocol_version,
PG_TLS_ANY,
ssl_protocol_versions_info,
- check_ssl_max_protocol_version, NULL, NULL
+ NULL, NULL, NULL
},
/* End-of-list marker */
@@ -11643,49 +11639,6 @@ assign_backtrace_functions(const char *newval, void *extra)
}
static bool
-check_ssl_min_protocol_version(int *newval, void **extra, GucSource source)
-{
- int new_ssl_min_protocol_version = *newval;
-
- /* PG_TLS_ANY is not supported for the minimum bound */
- Assert(new_ssl_min_protocol_version > PG_TLS_ANY);
-
- if (ssl_max_protocol_version &&
- new_ssl_min_protocol_version > ssl_max_protocol_version)
- {
- GUC_check_errhint("\"%s\" cannot be higher than \"%s\".",
- "ssl_min_protocol_version",
- "ssl_max_protocol_version");
- GUC_check_errcode(ERRCODE_INVALID_PARAMETER_VALUE);
- return false;
- }
-
- return true;
-}
-
-static bool
-check_ssl_max_protocol_version(int *newval, void **extra, GucSource source)
-{
- int new_ssl_max_protocol_version = *newval;
-
- /* if PG_TLS_ANY, there is no need to check the bounds */
- if (new_ssl_max_protocol_version == PG_TLS_ANY)
- return true;
-
- if (ssl_min_protocol_version &&
- ssl_min_protocol_version > new_ssl_max_protocol_version)
- {
- GUC_check_errhint("\"%s\" cannot be lower than \"%s\".",
- "ssl_max_protocol_version",
- "ssl_min_protocol_version");
- GUC_check_errcode(ERRCODE_INVALID_PARAMETER_VALUE);
- return false;
- }
-
- return true;
-}
-
-static bool
check_recovery_target_timeline(char **newval, void **extra, GucSource source)
{
RecoveryTargetTimeLineGoal rttg;