diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-09-21 17:06:12 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-09-21 17:06:12 +0000 |
commit | 35b7601b0484f8cf73299932b610bba6bcdde387 (patch) | |
tree | be929f72b1fa13a689ce36d7afcddd777375c44e /src/backend/tcop/postgres.c | |
parent | e3f5bc3492efa1fa6d20491bb3134c9b32f30b7d (diff) | |
download | postgresql-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/tcop/postgres.c')
-rw-r--r-- | src/backend/tcop/postgres.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 3aa28e1dbe0..feb8aea129f 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.232 2001/09/08 01:10:20 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.233 2001/09/21 17:06:12 tgl Exp $ * * NOTES * this is the "main" module of the postgres backend and @@ -967,12 +967,12 @@ die(SIGNAL_ARGS) } /* - * Shutdown signal from postmaster during client authentication. + * Timeout or shutdown signal from postmaster during client authentication. * Simply exit(0). * * XXX: possible future improvement: try to send a message indicating * why we are disconnecting. Problem is to be sure we don't block while - * doing so nor mess up the authentication message exchange. + * doing so, nor mess up the authentication message exchange. */ void authdie(SIGNAL_ARGS) @@ -1169,16 +1169,6 @@ PostgresMain(int argc, char *argv[], SetProcessingMode(InitProcessing); /* - * If under postmaster, initialize libpq and enable reporting of - * elog errors to the client. - */ - if (IsUnderPostmaster) - { - pq_init(); /* initialize libpq at backend startup */ - whereToSendOutput = Remote; /* now safe to elog to client */ - } - - /* * Set default values for command-line options. */ Noversion = false; @@ -1736,7 +1726,7 @@ PostgresMain(int argc, char *argv[], if (!IsUnderPostmaster) { puts("\nPOSTGRES backend interactive interface "); - puts("$Revision: 1.232 $ $Date: 2001/09/08 01:10:20 $\n"); + puts("$Revision: 1.233 $ $Date: 2001/09/21 17:06:12 $\n"); } /* |