pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. 7+ messages / 1 participants [nested] [flat]
* pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. @ 2025-10-05 20:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-10-05 20:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. On Windows, this code did not handle error conditions correctly at all, since it looked at "errno" which is not used for socket-related errors on that platform. This resulted, for example, in failure to connect to a PostgreSQL server with GSSAPI enabled. We have a convention for dealing with this within libpq, which is to use SOCK_ERRNO and SOCK_ERRNO_SET rather than touching errno directly; but the GSSAPI code is a relative latecomer and did not get that memo. (The equivalent backend code continues to use errno, because the backend does this differently. Maybe libpq's approach should be rethought someday.) Apparently nobody tries to build libpq with GSSAPI support on Windows, or we'd have heard about this before, because it's been broken all along. Back-patch to all supported branches. Author: Ning Wu <ning94803@gmail.com> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAFGqpvg-pRw=cdsUpKYfwY6D3d-m9tw8WMcAEE7HHWfm-oYWvw@mail.gmail.com Backpatch-through: 13 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/ea78bd6d5d0f18c09db1e3ec6fd19be38d706030 Modified Files -------------- src/interfaces/libpq/fe-secure-gssapi.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. @ 2025-10-05 20:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-10-05 20:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. On Windows, this code did not handle error conditions correctly at all, since it looked at "errno" which is not used for socket-related errors on that platform. This resulted, for example, in failure to connect to a PostgreSQL server with GSSAPI enabled. We have a convention for dealing with this within libpq, which is to use SOCK_ERRNO and SOCK_ERRNO_SET rather than touching errno directly; but the GSSAPI code is a relative latecomer and did not get that memo. (The equivalent backend code continues to use errno, because the backend does this differently. Maybe libpq's approach should be rethought someday.) Apparently nobody tries to build libpq with GSSAPI support on Windows, or we'd have heard about this before, because it's been broken all along. Back-patch to all supported branches. Author: Ning Wu <ning94803@gmail.com> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAFGqpvg-pRw=cdsUpKYfwY6D3d-m9tw8WMcAEE7HHWfm-oYWvw@mail.gmail.com Backpatch-through: 13 Branch ------ REL_18_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d83879a32b481f0e23cd8a14f7849cff3f8898b5 Modified Files -------------- src/interfaces/libpq/fe-secure-gssapi.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. @ 2025-10-05 20:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-10-05 20:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. On Windows, this code did not handle error conditions correctly at all, since it looked at "errno" which is not used for socket-related errors on that platform. This resulted, for example, in failure to connect to a PostgreSQL server with GSSAPI enabled. We have a convention for dealing with this within libpq, which is to use SOCK_ERRNO and SOCK_ERRNO_SET rather than touching errno directly; but the GSSAPI code is a relative latecomer and did not get that memo. (The equivalent backend code continues to use errno, because the backend does this differently. Maybe libpq's approach should be rethought someday.) Apparently nobody tries to build libpq with GSSAPI support on Windows, or we'd have heard about this before, because it's been broken all along. Back-patch to all supported branches. Author: Ning Wu <ning94803@gmail.com> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAFGqpvg-pRw=cdsUpKYfwY6D3d-m9tw8WMcAEE7HHWfm-oYWvw@mail.gmail.com Backpatch-through: 13 Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/1c4671f7b7c378cc26d1953785a3aa249152958b Modified Files -------------- src/interfaces/libpq/fe-secure-gssapi.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. @ 2025-10-05 20:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-10-05 20:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. On Windows, this code did not handle error conditions correctly at all, since it looked at "errno" which is not used for socket-related errors on that platform. This resulted, for example, in failure to connect to a PostgreSQL server with GSSAPI enabled. We have a convention for dealing with this within libpq, which is to use SOCK_ERRNO and SOCK_ERRNO_SET rather than touching errno directly; but the GSSAPI code is a relative latecomer and did not get that memo. (The equivalent backend code continues to use errno, because the backend does this differently. Maybe libpq's approach should be rethought someday.) Apparently nobody tries to build libpq with GSSAPI support on Windows, or we'd have heard about this before, because it's been broken all along. Back-patch to all supported branches. Author: Ning Wu <ning94803@gmail.com> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAFGqpvg-pRw=cdsUpKYfwY6D3d-m9tw8WMcAEE7HHWfm-oYWvw@mail.gmail.com Backpatch-through: 13 Branch ------ REL_16_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/46c4478db421764c5785ddce4f07b34550316ec0 Modified Files -------------- src/interfaces/libpq/fe-secure-gssapi.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. @ 2025-10-05 20:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-10-05 20:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. On Windows, this code did not handle error conditions correctly at all, since it looked at "errno" which is not used for socket-related errors on that platform. This resulted, for example, in failure to connect to a PostgreSQL server with GSSAPI enabled. We have a convention for dealing with this within libpq, which is to use SOCK_ERRNO and SOCK_ERRNO_SET rather than touching errno directly; but the GSSAPI code is a relative latecomer and did not get that memo. (The equivalent backend code continues to use errno, because the backend does this differently. Maybe libpq's approach should be rethought someday.) Apparently nobody tries to build libpq with GSSAPI support on Windows, or we'd have heard about this before, because it's been broken all along. Back-patch to all supported branches. Author: Ning Wu <ning94803@gmail.com> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAFGqpvg-pRw=cdsUpKYfwY6D3d-m9tw8WMcAEE7HHWfm-oYWvw@mail.gmail.com Backpatch-through: 13 Branch ------ REL_15_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/771b106d1994c494e341257aa4ed6e31dd9c2a45 Modified Files -------------- src/interfaces/libpq/fe-secure-gssapi.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. @ 2025-10-05 20:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-10-05 20:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. On Windows, this code did not handle error conditions correctly at all, since it looked at "errno" which is not used for socket-related errors on that platform. This resulted, for example, in failure to connect to a PostgreSQL server with GSSAPI enabled. We have a convention for dealing with this within libpq, which is to use SOCK_ERRNO and SOCK_ERRNO_SET rather than touching errno directly; but the GSSAPI code is a relative latecomer and did not get that memo. (The equivalent backend code continues to use errno, because the backend does this differently. Maybe libpq's approach should be rethought someday.) Apparently nobody tries to build libpq with GSSAPI support on Windows, or we'd have heard about this before, because it's been broken all along. Back-patch to all supported branches. Author: Ning Wu <ning94803@gmail.com> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAFGqpvg-pRw=cdsUpKYfwY6D3d-m9tw8WMcAEE7HHWfm-oYWvw@mail.gmail.com Backpatch-through: 13 Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/f46d77377b9a0be25524a6339296c8a892059f2c Modified Files -------------- src/interfaces/libpq/fe-secure-gssapi.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. @ 2025-10-05 20:28 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2025-10-05 20:28 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. On Windows, this code did not handle error conditions correctly at all, since it looked at "errno" which is not used for socket-related errors on that platform. This resulted, for example, in failure to connect to a PostgreSQL server with GSSAPI enabled. We have a convention for dealing with this within libpq, which is to use SOCK_ERRNO and SOCK_ERRNO_SET rather than touching errno directly; but the GSSAPI code is a relative latecomer and did not get that memo. (The equivalent backend code continues to use errno, because the backend does this differently. Maybe libpq's approach should be rethought someday.) Apparently nobody tries to build libpq with GSSAPI support on Windows, or we'd have heard about this before, because it's been broken all along. Back-patch to all supported branches. Author: Ning Wu <ning94803@gmail.com> Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CAFGqpvg-pRw=cdsUpKYfwY6D3d-m9tw8WMcAEE7HHWfm-oYWvw@mail.gmail.com Backpatch-through: 13 Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/fc287cf3c4c98cef16297e89e5946a7c66ffa33e Modified Files -------------- src/interfaces/libpq/fe-secure-gssapi.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2025-10-05 20:28 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-10-05 20:28 pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. Tom Lane <tgl@sss.pgh.pa.us> 2025-10-05 20:28 pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. Tom Lane <tgl@sss.pgh.pa.us> 2025-10-05 20:28 pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. Tom Lane <tgl@sss.pgh.pa.us> 2025-10-05 20:28 pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. Tom Lane <tgl@sss.pgh.pa.us> 2025-10-05 20:28 pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. Tom Lane <tgl@sss.pgh.pa.us> 2025-10-05 20:28 pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. Tom Lane <tgl@sss.pgh.pa.us> 2025-10-05 20:28 pgsql: Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c. 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