public inbox for [email protected]
help / color / mirror / Atom feedFrom: Jacob Champion <[email protected]>
To: Christoph Berg <[email protected]>
Cc: Daniel Gustafsson <[email protected]>
Cc: Thomas Munro <[email protected]>
Cc: [email protected]
Subject: Re: pgsql: Add support for OAUTHBEARER SASL mechanism
Date: Mon, 31 Mar 2025 17:06:16 -0700
Message-ID: <CAOYmi+=4898tXuTvb2LstorRo9JsAnBcn8LE=qrgVPiPW8ZfCw@mail.gmail.com> (raw)
In-Reply-To: <CAOYmi+=SEwJ+7ATgxrkvDFyGb-FQ5FN9eF_RVMic6DAU3bk5zw@mail.gmail.com>
References: <[email protected]>
<[email protected]>
<CAOYmi+=SEwJ+7ATgxrkvDFyGb-FQ5FN9eF_RVMic6DAU3bk5zw@mail.gmail.com>
On Mon, Mar 31, 2025 at 4:09 PM Jacob Champion
<[email protected]> wrote:
> I don't have hurd-amd64 to test, but I'm working on a patch that will
> build and pass tests if I manually munge pg_config.h. We were skipping
> the useless tests via a $windows_os check; I think I should use
> check_pg_config() instead.
Proposed fix attached.
Thanks,
--Jacob
Attachments:
[application/octet-stream] 0001-oauth-Fix-build-on-platforms-without-epoll-kqueue.patch (2.3K, 2-0001-oauth-Fix-build-on-platforms-without-epoll-kqueue.patch)
download | inline diff:
From a6bce74459370e8b81654328d93a8ea4601274ed Mon Sep 17 00:00:00 2001
From: Jacob Champion <[email protected]>
Date: Mon, 31 Mar 2025 16:07:33 -0700
Subject: [PATCH] oauth: Fix build on platforms without epoll/kqueue
register_socket() missed a variable declaration if neither
HAVE_SYS_EPOLL_H nor HAVE_SYS_EVENT_H was defined.
While we're fixing that, adjust the tests to check pg_config.h for one
of the multiplexer implementations, rather than assuming that Windows is
the only platform without support. (Christoph reported this on
hurd-amd64, an experimental Debian.)
Reported-by: Christoph Berg <[email protected]>
Discussion: https://postgr.es/m/Z-sPFl27Y0ZC-VBl%40msg.df7cb.de
---
src/interfaces/libpq/fe-auth-oauth-curl.c | 4 ++--
src/test/modules/oauth_validator/t/001_server.pl | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/interfaces/libpq/fe-auth-oauth-curl.c b/src/interfaces/libpq/fe-auth-oauth-curl.c
index 9e0e8a9f2be..cd9c0323bb6 100644
--- a/src/interfaces/libpq/fe-auth-oauth-curl.c
+++ b/src/interfaces/libpq/fe-auth-oauth-curl.c
@@ -1172,8 +1172,9 @@ static int
register_socket(CURL *curl, curl_socket_t socket, int what, void *ctx,
void *socketp)
{
-#ifdef HAVE_SYS_EPOLL_H
struct async_ctx *actx = ctx;
+
+#ifdef HAVE_SYS_EPOLL_H
struct epoll_event ev = {0};
int res;
int op = EPOLL_CTL_ADD;
@@ -1231,7 +1232,6 @@ register_socket(CURL *curl, curl_socket_t socket, int what, void *ctx,
return 0;
#endif
#ifdef HAVE_SYS_EVENT_H
- struct async_ctx *actx = ctx;
struct kevent ev[2] = {0};
struct kevent ev_out[2];
struct timespec timeout = {0};
diff --git a/src/test/modules/oauth_validator/t/001_server.pl b/src/test/modules/oauth_validator/t/001_server.pl
index 30295364ebd..d88994abc24 100644
--- a/src/test/modules/oauth_validator/t/001_server.pl
+++ b/src/test/modules/oauth_validator/t/001_server.pl
@@ -26,9 +26,11 @@ if (!$ENV{PG_TEST_EXTRA} || $ENV{PG_TEST_EXTRA} !~ /\boauth\b/)
'Potentially unsafe test oauth not enabled in PG_TEST_EXTRA';
}
-if ($windows_os)
+unless (check_pg_config("#define HAVE_SYS_EVENT_H 1")
+ or check_pg_config("#define HAVE_SYS_EPOLL_H 1"))
{
- plan skip_all => 'OAuth server-side tests are not supported on Windows';
+ plan skip_all =>
+ 'OAuth server-side tests are not supported on this platform';
}
if ($ENV{with_libcurl} ne 'yes')
--
2.34.1
view thread (9+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: pgsql: Add support for OAUTHBEARER SASL mechanism
In-Reply-To: <CAOYmi+=4898tXuTvb2LstorRo9JsAnBcn8LE=qrgVPiPW8ZfCw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox