File tree 2 files changed +30
-0
lines changed
2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -1035,6 +1035,7 @@ config_sspi_auth(const char *pgdata)
1035
1035
* domainname ;
1036
1036
const char * username ;
1037
1037
char * errstr ;
1038
+ bool have_ipv6 ;
1038
1039
char fname [MAXPGPATH ];
1039
1040
int res ;
1040
1041
FILE * hba ,
@@ -1054,6 +1055,28 @@ config_sspi_auth(const char *pgdata)
1054
1055
exit (2 );
1055
1056
}
1056
1057
1058
+ /*
1059
+ * Like initdb.c:setup_config(), determine whether the platform recognizes
1060
+ * ::1 (IPv6 loopback) as a numeric host address string.
1061
+ */
1062
+ {
1063
+ struct addrinfo * gai_result ;
1064
+ struct addrinfo hints ;
1065
+ WSADATA wsaData ;
1066
+
1067
+ hints .ai_flags = AI_NUMERICHOST ;
1068
+ hints .ai_family = AF_UNSPEC ;
1069
+ hints .ai_socktype = 0 ;
1070
+ hints .ai_protocol = 0 ;
1071
+ hints .ai_addrlen = 0 ;
1072
+ hints .ai_canonname = NULL ;
1073
+ hints .ai_addr = NULL ;
1074
+ hints .ai_next = NULL ;
1075
+
1076
+ have_ipv6 = (WSAStartup (MAKEWORD (2 , 2 ), & wsaData ) == 0 &&
1077
+ getaddrinfo ("::1" , NULL , & hints , & gai_result ) == 0 );
1078
+ }
1079
+
1057
1080
/* Check a Write outcome and report any error. */
1058
1081
#define CW (cond ) \
1059
1082
do { \
@@ -1085,6 +1108,9 @@ config_sspi_auth(const char *pgdata)
1085
1108
CW (fputs ("# Configuration written by config_sspi_auth()\n" , hba ) >= 0 );
1086
1109
CW (fputs ("host all all 127.0.0.1/32 sspi include_realm=1 map=regress\n" ,
1087
1110
hba ) >= 0 );
1111
+ if (have_ipv6 )
1112
+ CW (fputs ("host all all ::1/128 sspi include_realm=1 map=regress\n" ,
1113
+ hba ) >= 0 );
1088
1114
CW (fclose (hba ) == 0 );
1089
1115
1090
1116
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($libpgcommon , $libpgport );
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($libpgcommon , $libpgport );
360
362
361
363
# src/bin
@@ -594,6 +596,8 @@ sub mkvcbuild
594
596
$pgregress -> AddFile(' src\test\regress\pg_regress_main.c' );
595
597
$pgregress -> AddIncludeDir(' src\port' );
596
598
$pgregress -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
599
+ $pgregress -> AddDefine(' FRONTEND' );
600
+ $pgregress -> AddLibrary(' ws2_32.lib' );
597
601
$pgregress -> AddReference($libpgcommon , $libpgport );
598
602
599
603
# fix up pg_xlogdump once it's been set up
You can’t perform that action at this time.
0 commit comments