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)
1039
1039
* domainname ;
1040
1040
char username [128 ];
1041
1041
DWORD sz = sizeof (username ) - 1 ;
1042
+ bool have_ipv6 ;
1042
1043
char fname [MAXPGPATH ];
1043
1044
int res ;
1044
1045
FILE * hba ,
@@ -1058,6 +1059,28 @@ config_sspi_auth(const char *pgdata)
1058
1059
exit (2 );
1059
1060
}
1060
1061
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
+
1061
1084
/* Check a Write outcome and report any error. */
1062
1085
#define CW (cond ) \
1063
1086
do { \
@@ -1089,6 +1112,9 @@ config_sspi_auth(const char *pgdata)
1089
1112
CW (fputs ("# Configuration written by config_sspi_auth()\n" , hba ) >= 0 );
1090
1113
CW (fputs ("host all all 127.0.0.1/32 sspi include_realm=1 map=regress\n" ,
1091
1114
hba ) >= 0 );
1115
+ if (have_ipv6 )
1116
+ CW (fputs ("host all all ::1/128 sspi include_realm=1 map=regress\n" ,
1117
+ hba ) >= 0 );
1092
1118
CW (fclose (hba ) == 0 );
1093
1119
1094
1120
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
307
307
$pgregress_ecpg -> AddIncludeDir(' src\test\regress' );
308
308
$pgregress_ecpg -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
309
309
$pgregress_ecpg -> AddDefine(' FRONTEND' );
310
+ $pgregress_ecpg -> AddLibrary(' ws2_32.lib' );
310
311
$pgregress_ecpg -> AddReference($libpgport );
311
312
312
313
my $isolation_tester =
@@ -332,6 +333,7 @@ sub mkvcbuild
332
333
$pgregress_isolation -> AddIncludeDir(' src\test\regress' );
333
334
$pgregress_isolation -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
334
335
$pgregress_isolation -> AddDefine(' FRONTEND' );
336
+ $pgregress_isolation -> AddLibrary(' ws2_32.lib' );
335
337
$pgregress_isolation -> AddReference($libpgport );
336
338
337
339
# src/bin
@@ -561,6 +563,8 @@ sub mkvcbuild
561
563
$pgregress -> AddFile(' src\test\regress\pg_regress_main.c' );
562
564
$pgregress -> AddIncludeDir(' src\port' );
563
565
$pgregress -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
566
+ $pgregress -> AddDefine(' FRONTEND' );
567
+ $pgregress -> AddLibrary(' ws2_32.lib' );
564
568
$pgregress -> AddReference($libpgport );
565
569
566
570
$solution -> Save();
You can’t perform that action at this time.
0 commit comments