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 @@ -1048,6 +1048,7 @@ config_sspi_auth(const char *pgdata)
1048
1048
* domainname ;
1049
1049
char username [128 ];
1050
1050
DWORD sz = sizeof (username ) - 1 ;
1051
+ bool have_ipv6 ;
1051
1052
char fname [MAXPGPATH ];
1052
1053
int res ;
1053
1054
FILE * hba ,
@@ -1067,6 +1068,28 @@ config_sspi_auth(const char *pgdata)
1067
1068
exit (2 );
1068
1069
}
1069
1070
1071
+ /*
1072
+ * Like initdb.c:setup_config(), determine whether the platform recognizes
1073
+ * ::1 (IPv6 loopback) as a numeric host address string.
1074
+ */
1075
+ {
1076
+ struct addrinfo * gai_result ;
1077
+ struct addrinfo hints ;
1078
+ WSADATA wsaData ;
1079
+
1080
+ hints .ai_flags = AI_NUMERICHOST ;
1081
+ hints .ai_family = AF_UNSPEC ;
1082
+ hints .ai_socktype = 0 ;
1083
+ hints .ai_protocol = 0 ;
1084
+ hints .ai_addrlen = 0 ;
1085
+ hints .ai_canonname = NULL ;
1086
+ hints .ai_addr = NULL ;
1087
+ hints .ai_next = NULL ;
1088
+
1089
+ have_ipv6 = (WSAStartup (MAKEWORD (2 , 2 ), & wsaData ) == 0 &&
1090
+ getaddrinfo ("::1" , NULL , & hints , & gai_result ) == 0 );
1091
+ }
1092
+
1070
1093
/* Check a Write outcome and report any error. */
1071
1094
#define CW (cond ) \
1072
1095
do { \
@@ -1098,6 +1121,9 @@ config_sspi_auth(const char *pgdata)
1098
1121
CW (fputs ("# Configuration written by config_sspi_auth()\n" , hba ) >= 0 );
1099
1122
CW (fputs ("host all all 127.0.0.1/32 sspi include_realm=1 map=regress\n" ,
1100
1123
hba ) >= 0 );
1124
+ if (have_ipv6 )
1125
+ CW (fputs ("host all all ::1/128 sspi include_realm=1 map=regress\n" ,
1126
+ hba ) >= 0 );
1101
1127
CW (fclose (hba ) == 0 );
1102
1128
1103
1129
snprintf (fname , sizeof (fname ), "%s/pg_ident.conf" , pgdata );
Original file line number Diff line number Diff line change @@ -272,6 +272,7 @@ sub mkvcbuild
272
272
$pgregress_ecpg -> AddIncludeDir(' src\test\regress' );
273
273
$pgregress_ecpg -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
274
274
$pgregress_ecpg -> AddDefine(' FRONTEND' );
275
+ $pgregress_ecpg -> AddLibrary(' ws2_32.lib' );
275
276
$pgregress_ecpg -> AddReference($libpgport );
276
277
277
278
my $isolation_tester = $solution -> AddProject(' isolationtester' ,' exe' ,' misc' );
@@ -294,6 +295,7 @@ sub mkvcbuild
294
295
$pgregress_isolation -> AddIncludeDir(' src\test\regress' );
295
296
$pgregress_isolation -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
296
297
$pgregress_isolation -> AddDefine(' FRONTEND' );
298
+ $pgregress_isolation -> AddLibrary(' ws2_32.lib' );
297
299
$pgregress_isolation -> AddReference($libpgport );
298
300
299
301
# src/bin
@@ -486,6 +488,8 @@ sub mkvcbuild
486
488
$pgregress -> AddFile(' src\test\regress\pg_regress_main.c' );
487
489
$pgregress -> AddIncludeDir(' src\port' );
488
490
$pgregress -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
491
+ $pgregress -> AddDefine(' FRONTEND' );
492
+ $pgregress -> AddLibrary(' ws2_32.lib' );
489
493
$pgregress -> AddReference($libpgport );
490
494
491
495
$solution -> Save();
You can’t perform that action at this time.
0 commit comments