aboutsummaryrefslogtreecommitdiff
path: root/contrib/auth_delay
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-11-18 17:15:06 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2012-11-18 17:15:06 -0500
commitb6e3798f3aa2747db145f25e03a8d34f2e5ec8c8 (patch)
treed0cd6b85e9106a4c9c3d02d9addd5ebf135449b6 /contrib/auth_delay
parentd038966ddb918872700f9f21affbc84d6bc2c029 (diff)
downloadpostgresql-b6e3798f3aa2747db145f25e03a8d34f2e5ec8c8.tar.gz
postgresql-b6e3798f3aa2747db145f25e03a8d34f2e5ec8c8.zip
Limit values of archive_timeout, post_auth_delay, auth_delay.milliseconds.
The previous definitions of these GUC variables allowed them to range up to INT_MAX, but in point of fact the underlying code would suffer overflows or other errors with large values. Reduce the maximum values to something that won't misbehave. There's no apparent value in working harder than this, since very large delays aren't sensible for any of these. (Note: the risk with archive_timeout is that if we're late checking the state, the timestamp difference it's being compared to might overflow. So we need some amount of slop; the choice of INT_MAX/2 is arbitrary.) Per followup investigation of bug #7670. Although this isn't a very significant fix, might as well back-patch.
Diffstat (limited to 'contrib/auth_delay')
-rw-r--r--contrib/auth_delay/auth_delay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/auth_delay/auth_delay.c b/contrib/auth_delay/auth_delay.c
index 4e0d5959d19..3131e827b82 100644
--- a/contrib/auth_delay/auth_delay.c
+++ b/contrib/auth_delay/auth_delay.c
@@ -59,7 +59,7 @@ _PG_init(void)
NULL,
&auth_delay_milliseconds,
0,
- 0, INT_MAX,
+ 0, INT_MAX / 1000,
PGC_SIGHUP,
GUC_UNIT_MS,
NULL,