File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -1043,6 +1043,7 @@ config_sspi_auth(const char *pgdata)
1043
1043
* domainname ;
1044
1044
char username [128 ];
1045
1045
DWORD sz = sizeof (username ) - 1 ;
1046
+ bool have_ipv6 ;
1046
1047
char fname [MAXPGPATH ];
1047
1048
int res ;
1048
1049
FILE * hba ,
@@ -1062,6 +1063,28 @@ config_sspi_auth(const char *pgdata)
1062
1063
exit (2 );
1063
1064
}
1064
1065
1066
+ /*
1067
+ * Like initdb.c:setup_config(), determine whether the platform recognizes
1068
+ * ::1 (IPv6 loopback) as a numeric host address string.
1069
+ */
1070
+ {
1071
+ struct addrinfo * gai_result ;
1072
+ struct addrinfo hints ;
1073
+ WSADATA wsaData ;
1074
+
1075
+ hints .ai_flags = AI_NUMERICHOST ;
1076
+ hints .ai_family = AF_UNSPEC ;
1077
+ hints .ai_socktype = 0 ;
1078
+ hints .ai_protocol = 0 ;
1079
+ hints .ai_addrlen = 0 ;
1080
+ hints .ai_canonname = NULL ;
1081
+ hints .ai_addr = NULL ;
1082
+ hints .ai_next = NULL ;
1083
+
1084
+ have_ipv6 = (WSAStartup (MAKEWORD (2 , 2 ), & wsaData ) == 0 &&
1085
+ getaddrinfo ("::1" , NULL , & hints , & gai_result ) == 0 );
1086
+ }
1087
+
1065
1088
/* Check a Write outcome and report any error. */
1066
1089
#define CW (cond ) \
1067
1090
do { \
@@ -1093,6 +1116,9 @@ config_sspi_auth(const char *pgdata)
1093
1116
CW (fputs ("# Configuration written by config_sspi_auth()\n" , hba ) >= 0 );
1094
1117
CW (fputs ("host all all 127.0.0.1/32 sspi include_realm=1 map=regress\n" ,
1095
1118
hba ) >= 0 );
1119
+ if (have_ipv6 )
1120
+ CW (fputs ("host all all ::1/128 sspi include_realm=1 map=regress\n" ,
1121
+ hba ) >= 0 );
1096
1122
CW (fclose (hba ) == 0 );
1097
1123
1098
1124
snprintf (fname , sizeof (fname ), "%s/pg_ident.conf" , pgdata );
Original file line number Diff line number Diff line change @@ -264,6 +264,7 @@ sub mkvcbuild
264
264
$pgregress_ecpg -> AddIncludeDir(' src\test\regress' );
265
265
$pgregress_ecpg -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
266
266
$pgregress_ecpg -> AddDefine(' FRONTEND' );
267
+ $pgregress_ecpg -> AddLibrary(' ws2_32.lib' );
267
268
$pgregress_ecpg -> AddReference($libpgport );
268
269
269
270
# src/bin
@@ -454,6 +455,8 @@ sub mkvcbuild
454
455
$pgregress -> AddFile(' src\test\regress\pg_regress_main.c' );
455
456
$pgregress -> AddIncludeDir(' src\port' );
456
457
$pgregress -> AddDefine(' HOST_TUPLE="i686-pc-win32vc"' );
458
+ $pgregress -> AddDefine(' FRONTEND' );
459
+ $pgregress -> AddLibrary(' ws2_32.lib' );
457
460
$pgregress -> AddReference($libpgport );
458
461
459
462
$solution -> Save();
You can’t perform that action at this time.
0 commit comments