1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-13 16:22:44 +03:00

Modify backend switch parsing to prevent 'insecure' switches

from being accepted when they are passed from client connection request.
Get rid of a couple that no longer do anything (like -P).
This commit is contained in:
Tom Lane
1999-05-22 17:47:54 +00:00
parent e9edb3ef92
commit cf1478982c
9 changed files with 211 additions and 181 deletions

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.28 1999/03/17 22:53:19 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.29 1999/05/22 17:47:46 tgl Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
@@ -36,7 +36,6 @@
#include "catalog/catname.h"
ProtocolVersion FrontendProtocol = PG_PROTOCOL_LATEST;
int Portfd = -1;
bool Noversion = false;
bool Quiet = false;
@@ -47,11 +46,11 @@ struct Port *MyProcPort;
long MyCancelKey;
char *DataDir = NULL;
/*
* The PGDATA directory user says to use, or defaults to via environment
* variable. NULL if no option given and no environment variable set
*/
Relation reldesc; /* current relation descriptor */
char OutputFileName[MAXPGPATH] = "";

View File

@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.27 1999/05/09 00:54:30 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/miscinit.c,v 1.28 1999/05/22 17:47:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -37,6 +37,7 @@
#include "utils/syscache.h"
#include "storage/fd.h" /* for O_ */
#include "storage/ipc.h" /* for proc_exit */
/*
* EnableAbortEnvVarName

View File

@@ -257,9 +257,13 @@ set_option_flag(int flag, int value)
/*
* Parse an option string like "name,name+,name-,name=value".
* Single options are delimited by ',',space,tab,newline or cr.
*
* If 'secure' is false, the option string came from a remote client via
* connection "debug options" field --- do not obey any requests that
* might potentially be security loopholes.
*/
void
parse_options(char *str)
parse_options(char *str, bool secure)
{
char *s,
*name;
@@ -384,7 +388,7 @@ read_pg_options(SIGNAL_ARGS)
p--;
*p = '\0';
verbose = pg_options[TRACE_VERBOSE];
parse_options(buffer);
parse_options(buffer, true);
verbose |= pg_options[TRACE_VERBOSE];
if (verbose || postgres_signal_arg == SIGHUP)
tprintf(TRACE_ALL, "read_pg_options: %s", buffer);