aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-09-21 17:06:12 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-09-21 17:06:12 +0000
commit35b7601b0484f8cf73299932b610bba6bcdde387 (patch)
treebe929f72b1fa13a689ce36d7afcddd777375c44e /src/backend/utils/misc/guc.c
parente3f5bc3492efa1fa6d20491bb3134c9b32f30b7d (diff)
downloadpostgresql-35b7601b0484f8cf73299932b610bba6bcdde387.tar.gz
postgresql-35b7601b0484f8cf73299932b610bba6bcdde387.zip
Add an overall timeout on the client authentication cycle, so that
a hung client or lost connection can't indefinitely block a postmaster child (not to mention the possibility of deliberate DoS attacks). Timeout is controlled by new authentication_timeout GUC variable, which I set to 60 seconds by default ... does that seem reasonable?
Diffstat (limited to 'src/backend/utils/misc/guc.c')
-rw-r--r--src/backend/utils/misc/guc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 5a5dcac47a6..00fc0bebd2d 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -4,7 +4,7 @@
* Support for grand unified configuration scheme, including SET
* command, configuration file, and command line options.
*
- * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.50 2001/09/21 03:32:35 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.51 2001/09/21 17:06:12 tgl Exp $
*
* Copyright 2000 by PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
@@ -41,6 +41,8 @@
/* XXX these should be in other modules' header files */
extern bool Log_connections;
+extern int PreAuthDelay;
+extern int AuthenticationTimeout;
extern int CheckPointTimeout;
extern int CommitDelay;
extern int CommitSiblings;
@@ -320,6 +322,12 @@ static struct config_int
{"max_locks_per_transaction", PGC_POSTMASTER, &max_locks_per_xact,
64, 10, INT_MAX, NULL, NULL},
+ {"authentication_timeout", PGC_SIGHUP, &AuthenticationTimeout,
+ 60, 1, 600, NULL, NULL},
+
+ {"pre_auth_delay", PGC_SIGHUP, &PreAuthDelay,
+ 0, 0, 60, NULL, NULL},
+
{"checkpoint_segments", PGC_SIGHUP, &CheckPointSegments,
3, 1, INT_MAX, NULL, NULL},