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

Commit29987b2

Browse files
committed
Avoid crash in "postgres -C guc" for a GUC with a null string value.
Emit "(null)" instead, which was the behavior all along on platformsthat don't crash, eg OS X. Per report from Jehan-Guillaume de Rorthais.Back-patch to 9.2 where -C option was introduced.Michael PaquierReport: <20160615204036.2d35d86a@firost>
1 parent832c3f9 commit29987b2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎src/backend/postmaster/postmaster.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,10 +847,14 @@ PostmasterMain(int argc, char *argv[])
847847
if (output_config_variable!=NULL)
848848
{
849849
/*
850-
* permission is handled because the user is reading inside the data
851-
* dir
850+
* "-C guc" was specified, so print GUC's value and exit. No extra
851+
* permission check is needed because the user is reading inside the
852+
* data dir.
852853
*/
853-
puts(GetConfigOption(output_config_variable, false, false));
854+
constchar*config_val=GetConfigOption(output_config_variable,
855+
false, false);
856+
857+
puts(config_val ?config_val :"(null)");
854858
ExitPostmaster(0);
855859
}
856860

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp