mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-02 21:16:54 +02:00
Fix path delimiters in connection string on Windows
The temporary path generated in commit c113d8ad5
cannot be passed as-is in
the connection string on Windows since the path delimiting backslashes will
be treated as escape characters. Fix by converting backslash to slash as in
similar path usecases in other tests.
Reported-by: Andres Freund <andres@anarazel.de>
Discussion: https://postgr.es/m/20211202195130.e7pprpsx4ell22sp@alap3.anarazel.de
This commit is contained in:
parent
557c39bba9
commit
49422ad0cc
@ -56,6 +56,7 @@ foreach my $keyfile (@keys)
|
|||||||
chmod 0600, "$cert_tempdir/$keyfile"
|
chmod 0600, "$cert_tempdir/$keyfile"
|
||||||
or die "failed to change permissions on $cert_tempdir/$keyfile: $!";
|
or die "failed to change permissions on $cert_tempdir/$keyfile: $!";
|
||||||
$key{$keyfile} = PostgreSQL::Test::Utils::perl2host("$cert_tempdir/$keyfile");
|
$key{$keyfile} = PostgreSQL::Test::Utils::perl2host("$cert_tempdir/$keyfile");
|
||||||
|
$key{$keyfile} =~ s!\\!/!g if $PostgreSQL::Test::Utils::windows_os;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Also make a copy of that explicitly world-readable. We can't
|
# Also make a copy of that explicitly world-readable. We can't
|
||||||
@ -67,7 +68,7 @@ copy("ssl/client.key", "$cert_tempdir/client_wrongperms.key")
|
|||||||
chmod 0644, "$cert_tempdir/client_wrongperms.key"
|
chmod 0644, "$cert_tempdir/client_wrongperms.key"
|
||||||
or die "failed to change permissions on $cert_tempdir/client_wrongperms.key: $!";
|
or die "failed to change permissions on $cert_tempdir/client_wrongperms.key: $!";
|
||||||
$key{'client_wrongperms.key'} = PostgreSQL::Test::Utils::perl2host("$cert_tempdir/client_wrongperms.key");
|
$key{'client_wrongperms.key'} = PostgreSQL::Test::Utils::perl2host("$cert_tempdir/client_wrongperms.key");
|
||||||
|
$key{'client_wrongperms.key'} =~ s!\\!/!g if $PostgreSQL::Test::Utils::windows_os;
|
||||||
#### Set up the server.
|
#### Set up the server.
|
||||||
|
|
||||||
note "setting up data directory";
|
note "setting up data directory";
|
||||||
|
@ -102,6 +102,7 @@ copy("ssl/client.key", "$cert_tempdir/client_scram.key")
|
|||||||
"couldn't copy ssl/client_key to $cert_tempdir/client_scram.key for permission change: $!";
|
"couldn't copy ssl/client_key to $cert_tempdir/client_scram.key for permission change: $!";
|
||||||
chmod 0600, "$cert_tempdir/client_scram.key"
|
chmod 0600, "$cert_tempdir/client_scram.key"
|
||||||
or die "failed to change permissions on $cert_tempdir/client_scram.key: $!";
|
or die "failed to change permissions on $cert_tempdir/client_scram.key: $!";
|
||||||
|
$client_tmp_key =~ s!\\!/!g if $PostgreSQL::Test::Utils::windows_os;
|
||||||
$node->connect_fails(
|
$node->connect_fails(
|
||||||
"sslcert=ssl/client.crt sslkey=$client_tmp_key sslrootcert=invalid hostaddr=$SERVERHOSTADDR dbname=certdb user=ssltestuser channel_binding=require",
|
"sslcert=ssl/client.crt sslkey=$client_tmp_key sslrootcert=invalid hostaddr=$SERVERHOSTADDR dbname=certdb user=ssltestuser channel_binding=require",
|
||||||
"Cert authentication and channel_binding=require",
|
"Cert authentication and channel_binding=require",
|
||||||
|
@ -44,6 +44,7 @@ copy("ssl/client_ext.key", "$cert_tempdir/client_ext.key")
|
|||||||
"couldn't copy ssl/client_ext.key to $cert_tempdir/client_ext.key for permissions change: $!";
|
"couldn't copy ssl/client_ext.key to $cert_tempdir/client_ext.key for permissions change: $!";
|
||||||
chmod 0600, "$cert_tempdir/client_ext.key"
|
chmod 0600, "$cert_tempdir/client_ext.key"
|
||||||
or die "failed to change permissions on $cert_tempdir/client_ext.key: $!";
|
or die "failed to change permissions on $cert_tempdir/client_ext.key: $!";
|
||||||
|
$client_tmp_key =~ s!\\!/!g if $PostgreSQL::Test::Utils::windows_os;
|
||||||
|
|
||||||
#### Set up the server.
|
#### Set up the server.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user