Commit 453c468
committed
Cope with a deficiency in OpenSSL 3.x's error reporting.
In OpenSSL 3.0.0 and later, ERR_reason_error_string randomly refuses
to provide a string for error codes representing system errno values
(e.g., "No such file or directory"). There is a poorly-documented way
to extract the errno from the SSL error code in this case, so do that
and apply strerror, rather than falling back to reporting the error
code's numeric value as we were previously doing.
Problem reported by David Zhang, although this is not his proposed
patch; it's instead based on a suggestion from Heikki Linnakangas.
Back-patch to all supported branches, since any of them are likely
to be used with recent OpenSSL.
Discussion: https://postgr.es/m/b6fb018b-f05c-4afd-abd3-318c649faf18@highgo.ca1 parent d61a6ca commit 453c468
File tree
2 files changed
+36
-6
lines changed- src
- backend/libpq
- interfaces/libpq
2 files changed
+36
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1348 | 1348 | | |
1349 | 1349 | | |
1350 | 1350 | | |
1351 | | - | |
1352 | | - | |
1353 | | - | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
1354 | 1354 | | |
1355 | 1355 | | |
1356 | 1356 | | |
| |||
1363 | 1363 | | |
1364 | 1364 | | |
1365 | 1365 | | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
1366 | 1379 | | |
1367 | 1380 | | |
1368 | 1381 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1662 | 1662 | | |
1663 | 1663 | | |
1664 | 1664 | | |
| 1665 | + | |
1665 | 1666 | | |
1666 | | - | |
1667 | | - | |
1668 | | - | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
1669 | 1670 | | |
1670 | 1671 | | |
1671 | 1672 | | |
| |||
1691 | 1692 | | |
1692 | 1693 | | |
1693 | 1694 | | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
| 1699 | + | |
| 1700 | + | |
| 1701 | + | |
| 1702 | + | |
| 1703 | + | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
1694 | 1711 | | |
1695 | 1712 | | |
1696 | 1713 | | |
| |||
0 commit comments