Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc4342c9

Browse files
committed
Fix removal of files generated by TAP tests for SSL
001_ssltests.pl and 002_scram.pl both generated an extra file for aclient key used in the tests that were not removed. In Debian, thiscauses repeated builds to fail.The code refactoring done in4dc6355 broke the cleanup done in001_ssltests.pl, and the new tests added in 002_scram.pl viad6e612fforgot the removal of one file. While on it, fix a second issueintroduced in 002_scram.pl where we use the same file name in 001 and002 for the temporary client key whose permissions are changed in thetest, as using the same file name in both tests could cause failureswith parallel jobs of src/test/ssl/ if one test removes a file stillneeded by the second test.Reported-by: Felix LechnerAuthor: Daniel Gustafsson, Felix LechnerReviewed-by: Tom Lane, Michael PaquierDiscussion:https://postgr.es/m/CAFHYt543sjX=Cm_aEeoejStyP47C+Y3+Wh6WbirLXsgUMaw7iw@mail.gmail.comBackpatch-through: 13
1 parent40efbf8 commitc4342c9

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

‎src/test/ssl/t/001_ssltests.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@
5252

5353
# Also make a copy of that explicitly world-readable. We can't
5454
# necessarily rely on the file in the source tree having those
55-
# permissions.
55+
# permissions. Add it to @keys to include it in the final clean
56+
# up phase.
5657
copy("ssl/client.key","ssl/client_wrongperms_tmp.key");
5758
chmod 0644,"ssl/client_wrongperms_tmp.key";
59+
push@keys,'client_wrongperms';
5860

5961
#### Set up the server.
6062

‎src/test/ssl/t/002_scram.pl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,20 @@
8989
qr/channel binding required but not supported by server's authentication request/,
9090
"MD5 with SSL and channel_binding=require");
9191

92-
# Now test with auth method 'cert' by connecting to 'certdb'. Should
93-
# fail, because channel binding is not performed.
94-
copy("ssl/client.key","ssl/client_tmp.key");
95-
chmod 0600,"ssl/client_tmp.key";
92+
# Now test with auth method 'cert' by connecting to 'certdb'. Should fail,
93+
# because channel binding is not performed. Note that ssl/client.key may
94+
# be used in a different test, so the name of this temporary client key
95+
# is chosen here to be unique.
96+
my$client_tmp_key ="ssl/client_scram_tmp.key";
97+
copy("ssl/client.key",$client_tmp_key);
98+
chmod 0600,$client_tmp_key;
9699
test_connect_fails(
97-
"sslcert=ssl/client.crt sslkey=ssl/client_tmp.key hostaddr=$SERVERHOSTADDR",
100+
"sslcert=ssl/client.crt sslkey=$client_tmp_key hostaddr=$SERVERHOSTADDR",
98101
"dbname=certdb user=ssltestuser channel_binding=require",
99102
qr/channel binding required, but server authenticated client without channel binding/,
100103
"Cert authentication and channel_binding=require");
101104

105+
# clean up
106+
unlink($client_tmp_key);
107+
102108
done_testing($number_of_tests);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp