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

Commitdc57366

Browse files
committed
Fix check for PGHOST[ADDR] in pg_upgrade with Windows and temporary paths
The checks currently done at the startup of pg_upgrade on PGHOST andPGHOSTADDR to avoid any attempts to access to an external cluster failsetting those parameters to Windows paths or even temporary pathsprefixed by an '@', as it only considers as a valid path stringsbeginning with a slash.As mentioned by Andres, is_unixsock_path() is designed to detect suchcases, so, like any other code paths dealing with the same problem (psqland libpq), use it rather than assuming that all valid paths areprefixed with just a slash.This issue has been found while testing the TAP tests of pg_upgradethrough the CI on Windows. This is a bug, but nobody has complainedabout it since pg_upgrade exists so no backpatch is done, at least fornow.Analyzed-by: Andres Freund, Michael PaquierDiscussion:https://postgr.es/m/YeYj4DU5qY/rtKXT@paquier.xyz
1 parent9028cce commitdc57366

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/bin/pg_upgrade/server.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include"common/connect.h"
1313
#include"fe_utils/string_utils.h"
14+
#include"libpq/pqcomm.h"
1415
#include"pg_upgrade.h"
1516

1617
staticPGconn*get_db_conn(ClusterInfo*cluster,constchar*db_name);
@@ -368,7 +369,7 @@ check_pghost_envvar(void)
368369
if (value&&strlen(value)>0&&
369370
/* check for 'local' host values */
370371
(strcmp(value,"localhost")!=0&&strcmp(value,"127.0.0.1")!=0&&
371-
strcmp(value,"::1")!=0&&value[0]!='/'))
372+
strcmp(value,"::1")!=0&&!is_unixsock_path(value)))
372373
pg_fatal("libpq environment variable %s has a non-local server value: %s\n",
373374
option->envvar,value);
374375
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp