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 @@ -1040,6 +1040,7 @@ config_sspi_auth(const char *pgdata)
1040
1040
* domainname ;
1041
1041
char username [128 ];
1042
1042
DWORD sz = sizeof (username ) - 1 ;
1043
+ bool have_ipv6 ;
1043
1044
char fname [MAXPGPATH ];
1044
1045
int res ;
1045
1046
FILE * hba ,
@@ -1059,6 +1060,28 @@ config_sspi_auth(const char *pgdata)
1059
1060
exit (2 );
1060
1061
}
1061
1062
1063
+ /*
1064
+ * Like initdb.c:setup_config(), determine whether the platform recognizes
1065
+ * ::1 (IPv6 loopback) as a numeric host address string.
1066
+ */
1067
+ {
1068
+ struct addrinfo * gai_result ;
1069
+ struct addrinfo hints ;
1070
+ WSADATA wsaData ;
1071
+
1072
+ hints .ai_flags = AI_NUMERICHOST ;
1073
+ hints .ai_family = AF_UNSPEC ;
1074
+ hints .ai_socktype = 0 ;
1075
+ hints .ai_protocol = 0 ;
1076
+ hints .ai_addrlen = 0 ;
1077
+ hints .ai_canonname = NULL ;
1078
+ hints .ai_addr = NULL ;
1079
+ hints .ai_next = NULL ;
1080
+
1081
+ have_ipv6 = (WSAStartup (MAKEWORD (2 , 2 ), & wsaData ) == 0 &&
1082
+ getaddrinfo ("::1" , NULL , & hints , & gai_result ) == 0 );
1083
+ }
1084
+
1062
1085
/* Check a Write outcome and report any error. */
1063
1086
#define CW (cond ) \
1064
1087
do { \
@@ -1090,6 +1113,9 @@ config_sspi_auth(const char *pgdata)
1090
1113
CW (fputs ("# Configuration written by config_sspi_auth()\n" , hba ) >= 0 );
1091
1114
CW (fputs ("host all all 127.0.0.1/32 sspi include_realm=1 map=regress\n" ,
1092
1115
hba ) >= 0 );
1116
+ if (have_ipv6 )
1117
+ CW (fputs ("host all all ::1/128 sspi include_realm=1 map=regress\n" ,
1118
+ hba ) >= 0 );
1093
1119
CW (fclose (hba ) == 0 );
1094
1120
1095
1121
snprintf (fname , sizeof (fname ), "%s/pg_ident.conf" , pgdata );
Original file line number Diff line number Diff line change @@ -331,6 +331,7 @@ sub mkvcbuild
331
331
$pgregress_ecpg -> AddIncludeDir(' src\test\regress' );
332
332
$pgregress_ecpg -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
333
333
$pgregress_ecpg -> AddDefine(' FRONTEND' );
334
+ $pgregress_ecpg -> AddLibrary(' ws2_32.lib' );
334
335
$pgregress_ecpg -> AddReference($libpgport , $libpgcommon );
335
336
336
337
my $isolation_tester =
@@ -356,6 +357,7 @@ sub mkvcbuild
356
357
$pgregress_isolation -> AddIncludeDir(' src\test\regress' );
357
358
$pgregress_isolation -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
358
359
$pgregress_isolation -> AddDefine(' FRONTEND' );
360
+ $pgregress_isolation -> AddLibrary(' ws2_32.lib' );
359
361
$pgregress_isolation -> AddReference($libpgport , $libpgcommon );
360
362
361
363
# src/bin
@@ -589,6 +591,8 @@ sub mkvcbuild
589
591
$pgregress -> AddFile(' src\test\regress\pg_regress_main.c' );
590
592
$pgregress -> AddIncludeDir(' src\port' );
591
593
$pgregress -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
594
+ $pgregress -> AddDefine(' FRONTEND' );
595
+ $pgregress -> AddLibrary(' ws2_32.lib' );
592
596
$pgregress -> AddReference($libpgport , $libpgcommon );
593
597
594
598
# fix up pg_xlogdump once it's been set up
You can’t perform that action at this time.
0 commit comments