File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1039,6 +1039,7 @@ config_sspi_auth(const char *pgdata)
10391039 * domainname ;
10401040 char username [128 ];
10411041 DWORD sz = sizeof (username ) - 1 ;
1042+ bool have_ipv6 ;
10421043 char fname [MAXPGPATH ];
10431044 int res ;
10441045 FILE * hba ,
@@ -1058,6 +1059,28 @@ config_sspi_auth(const char *pgdata)
10581059 exit (2 );
10591060 }
10601061
1062+ /*
1063+ * Like initdb.c:setup_config(), determine whether the platform recognizes
1064+ * ::1 (IPv6 loopback) as a numeric host address string.
1065+ */
1066+ {
1067+ struct addrinfo * gai_result ;
1068+ struct addrinfo hints ;
1069+ WSADATA wsaData ;
1070+
1071+ hints .ai_flags = AI_NUMERICHOST ;
1072+ hints .ai_family = AF_UNSPEC ;
1073+ hints .ai_socktype = 0 ;
1074+ hints .ai_protocol = 0 ;
1075+ hints .ai_addrlen = 0 ;
1076+ hints .ai_canonname = NULL ;
1077+ hints .ai_addr = NULL ;
1078+ hints .ai_next = NULL ;
1079+
1080+ have_ipv6 = (WSAStartup (MAKEWORD (2 , 2 ), & wsaData ) == 0 &&
1081+ getaddrinfo ("::1" , NULL , & hints , & gai_result ) == 0 );
1082+ }
1083+
10611084 /* Check a Write outcome and report any error. */
10621085#define CW (cond ) \
10631086 do { \
@@ -1089,6 +1112,9 @@ config_sspi_auth(const char *pgdata)
10891112 CW (fputs ("# Configuration written by config_sspi_auth()\n" , hba ) >= 0 );
10901113 CW (fputs ("host all all 127.0.0.1/32 sspi include_realm=1 map=regress\n" ,
10911114 hba ) >= 0 );
1115+ if (have_ipv6 )
1116+ CW (fputs ("host all all ::1/128 sspi include_realm=1 map=regress\n" ,
1117+ hba ) >= 0 );
10921118 CW (fclose (hba ) == 0 );
10931119
10941120 snprintf (fname , sizeof (fname ), "%s/pg_ident.conf" , pgdata );
Original file line number Diff line number Diff line change @@ -307,6 +307,7 @@ sub mkvcbuild
307307 $pgregress_ecpg -> AddIncludeDir(' src\test\regress' );
308308 $pgregress_ecpg -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
309309 $pgregress_ecpg -> AddDefine(' FRONTEND' );
310+ $pgregress_ecpg -> AddLibrary(' ws2_32.lib' );
310311 $pgregress_ecpg -> AddReference($libpgport );
311312
312313 my $isolation_tester =
@@ -332,6 +333,7 @@ sub mkvcbuild
332333 $pgregress_isolation -> AddIncludeDir(' src\test\regress' );
333334 $pgregress_isolation -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
334335 $pgregress_isolation -> AddDefine(' FRONTEND' );
336+ $pgregress_isolation -> AddLibrary(' ws2_32.lib' );
335337 $pgregress_isolation -> AddReference($libpgport );
336338
337339 # src/bin
@@ -561,6 +563,8 @@ sub mkvcbuild
561563 $pgregress -> AddFile(' src\test\regress\pg_regress_main.c' );
562564 $pgregress -> AddIncludeDir(' src\port' );
563565 $pgregress -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
566+ $pgregress -> AddDefine(' FRONTEND' );
567+ $pgregress -> AddLibrary(' ws2_32.lib' );
564568 $pgregress -> AddReference($libpgport );
565569
566570 $solution -> Save();
You can’t perform that action at this time.
0 commit comments