Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4467194

Browse files
committed
Reduce proc_exit(1) to proc_exit(0) for errors detected in backend
command line processing. As it stood, a bogus PGOPTIONS value froma client would force a database system restart. Not bad as a denial-of-service attack...
1 parente79b2dd commit4467194

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.143 2000/02/19 22:10:47 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.144 2000/02/20 04:26:35 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -1256,15 +1256,15 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
12561256
(ShowParserStats||ShowPlannerStats||ShowExecutorStats))
12571257
{
12581258
fprintf(stderr,"-s can not be used together with -t.\n");
1259-
proc_exit(1);
1259+
proc_exit(0);
12601260
}
12611261

12621262
if (!DataDir)
12631263
{
12641264
fprintf(stderr,"%s does not know where to find the database system "
12651265
"data. You must specify the directory that contains the "
12661266
"database system either by specifying the -D invocation "
1267-
"option or by setting the PGDATA environment variable.\n\n",
1267+
"option or by setting the PGDATA environment variable.\n\n",
12681268
argv[0]);
12691269
proc_exit(1);
12701270
}
@@ -1324,7 +1324,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
13241324
if (errs||argc!=optind||DBName==NULL)
13251325
{
13261326
usage(argv[0]);
1327-
proc_exit(1);
1327+
proc_exit(0);
13281328
}
13291329
pq_init();/* initialize libpq at backend startup */
13301330
whereToSendOutput=Remote;
@@ -1337,15 +1337,15 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
13371337
if (errs||argc-optind>1)
13381338
{
13391339
usage(argv[0]);
1340-
proc_exit(1);
1340+
proc_exit(0);
13411341
}
13421342
elseif (argc-optind==1)
13431343
DBName=argv[optind];
13441344
elseif ((DBName=userName)==NULL)
13451345
{
13461346
fprintf(stderr,"%s: USER undefined and no database specified\n",
13471347
argv[0]);
1348-
proc_exit(1);
1348+
proc_exit(0);
13491349
}
13501350

13511351
/*
@@ -1503,14 +1503,14 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
15031503
if (!IsUnderPostmaster)
15041504
{
15051505
puts("\nPOSTGRES backend interactive interface ");
1506-
puts("$Revision: 1.143 $ $Date: 2000/02/19 22:10:47 $\n");
1506+
puts("$Revision: 1.144 $ $Date: 2000/02/20 04:26:35 $\n");
15071507
}
15081508

15091509
/*
15101510
* Initialize the deferred trigger manager
15111511
*/
15121512
if (DeferredTriggerInit()!=0)
1513-
proc_exit(1);
1513+
proc_exit(0);
15141514

15151515
SetProcessingMode(NormalProcessing);
15161516

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp