pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix poor errno handling in libpq's version of our custom OpenSSL
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix poor errno handling in libpq's version of our custom OpenSSL
@ 2015-09-28 22:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2015-09-28 22:02 UTC (permalink / raw)
  To: pgsql-committers

Fix poor errno handling in libpq's version of our custom OpenSSL BIO.

Thom Brown reported that SSL connections didn't seem to work on Windows in
9.5.  Asif Naeem figured out that the cause was my_sock_read() looking at
"errno" when it needs to look at "SOCK_ERRNO".  This mistake was introduced
in commit 680513ab79c7e12e402a2aad7921b95a25a4bcc8, which cloned the
backend's custom SSL BIO code into libpq, and didn't translate the errno
handling properly.  Moreover, it introduced unnecessary errno save/restore
logic, which was particularly confusing because it was incomplete; and it
failed to check for all three of EINTR, EAGAIN, and EWOULDBLOCK in
my_sock_write.  (That might not be necessary; but since we're copying
well-tested backend code that does do that, it seems prudent to copy it
faithfully.)

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/b67c9c1939f10e94186d2736039ff623dbb2ce3f

Modified Files
--------------
src/interfaces/libpq/fe-secure-openssl.c |   24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix poor errno handling in libpq's version of our custom OpenSSL
@ 2015-09-28 22:02  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2015-09-28 22:02 UTC (permalink / raw)
  To: pgsql-committers

Fix poor errno handling in libpq's version of our custom OpenSSL BIO.

Thom Brown reported that SSL connections didn't seem to work on Windows in
9.5.  Asif Naeem figured out that the cause was my_sock_read() looking at
"errno" when it needs to look at "SOCK_ERRNO".  This mistake was introduced
in commit 680513ab79c7e12e402a2aad7921b95a25a4bcc8, which cloned the
backend's custom SSL BIO code into libpq, and didn't translate the errno
handling properly.  Moreover, it introduced unnecessary errno save/restore
logic, which was particularly confusing because it was incomplete; and it
failed to check for all three of EINTR, EAGAIN, and EWOULDBLOCK in
my_sock_write.  (That might not be necessary; but since we're copying
well-tested backend code that does do that, it seems prudent to copy it
faithfully.)

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/60f1e6bc130241c1f1da337d0a08a05ee8b982d8

Modified Files
--------------
src/interfaces/libpq/fe-secure-openssl.c |   24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-09-28 22:02 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-09-28 22:02 pgsql: Fix poor errno handling in libpq's version of our custom OpenSSL Tom Lane <tgl@sss.pgh.pa.us>
2015-09-28 22:02 pgsql: Fix poor errno handling in libpq's version of our custom OpenSSL Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox