]> granicus.if.org Git - postgresql/commitdiff
Allow SSL TAP tests to run on Windows
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 29 Sep 2019 21:32:46 +0000 (17:32 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Sun, 29 Sep 2019 21:50:44 +0000 (17:50 -0400)
Windows does not enforce key file permissions checks in libpq, and psql
can produce CRLF line endings on Windows.

Backpatch to Release 12 (CRLF) and Release 11 (permissions check)

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

index d5dcb46536266a90dbb2aaae6719608b711f9b8e..b5c5d1a40dd0d7f0dff465543cc9d0b0696d56f9 100644 (file)
@@ -332,11 +332,16 @@ test_connect_ok(
        "certificate authorization succeeds with correct client cert");
 
 # client key with wrong permissions
-test_connect_fails(
-       $common_connstr,
-       "user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client_wrongperms_tmp.key",
-       qr!\Qprivate key file "ssl/client_wrongperms_tmp.key" has group or world access\E!,
-       "certificate authorization fails because of file permissions");
+SKIP:
+{
+       skip "Permissions check not enforced on Windows", 2 if ($windows_os);
+
+       test_connect_fails(
+               $common_connstr,
+               "user=ssltestuser sslcert=ssl/client.crt sslkey=ssl/client_wrongperms_tmp.key",
+               qr!\Qprivate key file "ssl/client_wrongperms_tmp.key" has group or world access\E!,
+               "certificate authorization fails because of file permissions");
+}
 
 # client cert belonging to another user
 test_connect_fails(