Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sQxIK-00CW6D-CT for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jul 2024 22:57:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sQxII-00AK3M-8S for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jul 2024 22:57:14 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sQxIG-00AK1g-AZ for pgsql-hackers@lists.postgresql.org; Mon, 08 Jul 2024 22:57:13 +0000 Received: from fhigh4-smtp.messagingengine.com ([103.168.172.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sQxI8-0016by-1n; Mon, 08 Jul 2024 22:57:10 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 3375111410B0; Mon, 8 Jul 2024 18:57:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 08 Jul 2024 18:57:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2; t=1720479422; x=1720565822; bh=WIQ+ZGH+LHgI/dAr7YyHJtp89MBBNZi4 /RO4A88bwh4=; b=aK2+SeWacrqjphuWPv4fqj4Shr8rGuxOj9EucdmkVOYmWQrJ INEZYLYHQUPWVpcOZNRLZ+5POYKr1m1Ojsg5uJN2IcpVAII0NshFUJOYHf1y3+wT ZH5x3iASIPvgkm5BuS9AHnJETZyns4ackhT4zwkOYfO4eHAvgWDl2TR2nNgZiFV5 KQSXuqlTT/Babsn++8/36Sh4uA/FUKxGgA2lDPQ6xP5+lpaxjxF8/UeL+hI2jiHJ VelhZMbaYdjJyDOLswvkI2GYZNkzs56EquwfPgqIeTQ8JF7MhJ/FEym0FqKodILP aTuPDqra2QQfPW17SWkLS8B4ZtgM7EqOZvw69Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1720479422; x=1720565822; bh=WIQ+ZGH+LHgI/dAr7YyHJtp89MBBNZi4/RO 4A88bwh4=; b=MXYyNXC1hsOQ/epECONPX97+EV/uQw87O4CXc/bpmAFuN7bAUyA JMTnGIZj7+qepdiuZpaJOIqNhDpKo7fxrkflKpVZTC+QPLqgaFziTOt3PyjgQohT RMgwWbzRU22Xf7WvPfJ/wneMh3j8jTLxDjpzW3h/XPGV94nQpb4nkqfHAEeq2EV+ OapYb/HoTTGp0zNERwzS1hGGDdIlhbzcH8LLlsUkgRzlnunwNeCXeF1EuWPxdHQF ZXsF+awmxY1O7gNtjztw+VR//ldwqVLvRVs4NiWyo7tBOtew0MoyEQXivliPRf3b 84lUsaSqfOT5bkhuVlaC35KEctUwaOfJg4A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdekgdduiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggusehmtderredttddvnecuhfhrohhmpeetnhgurhgvshcu hfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtffrrghtth gvrhhnpeevleevffekveekhffhgeekvdfgfeeggefgudffudefveegheduheekfeefkeeu leenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnh gurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 Jul 2024 18:57:00 -0400 (EDT) Date: Mon, 8 Jul 2024 15:56:59 -0700 From: Andres Freund To: pgsql-hackers@postgresql.org, Stephen Frost Cc: "Jonathan S. Katz" Subject: Why do we define HAVE_GSSAPI_EXT_H? Message-ID: <20240708225659.gmyqoosi7km6ysgn@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ps22nm2377upipkw" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --ps22nm2377upipkw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, Since commit f7431bca8b0138bdbce7025871560d39119565a0 Author: Stephen Frost Date: 2023-04-13 08:55:13 -0400 Explicitly require MIT Kerberos for GSSAPI WHen building with GSSAPI support, explicitly require MIT Kerberos and check for gssapi_ext.h in configure.ac and meson.build. Also add documentation explicitly stating that we now require MIT Kerberos when building with GSSAPI support. configure/meson define HAVE_GSSAPI_EXT_H / HAVE_GSSAPI_GSSAPI_EXT_H - but afaict we don't use those anywhere? It makes sense to test for the presence of gssapi_ext.h, but given that we require it to be present, I think it's not worth emitting HAVE_GSSAPI_EXT_H etc. As f7431bca8b is in 16, it seems best to just change this in 18. While looking at this I also found an argument omission present in the commit adding meson support. I plan to fix that with the attached commit. Greetings, Andres Freund --ps22nm2377upipkw Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-meson-Add-missing-argument-to-gssapi.h-check.patch" From 4e036f77bad5264cda625222068b706555d7f85a Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Mon, 8 Jul 2024 15:28:04 -0700 Subject: [PATCH v1 1/2] meson: Add missing argument to gssapi.h check These were missing since the initial introduction of the meson based build, in e6927270cd18. As-is this is unlikely to cause an issue, but a future commit will add support for detecting gssapi without use of dependency(), which could fail due to this. Backpatch: 16-, where the meson based build was added --- meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 5387bb6d5fd..102b1e98a27 100644 --- a/meson.build +++ b/meson.build @@ -621,7 +621,8 @@ if not gssapiopt.disabled() elif cc.check_header('gssapi/gssapi.h', dependencies: gssapi, required: false, args: test_c_args, include_directories: postgres_inc) cdata.set('HAVE_GSSAPI_GSSAPI_H', 1) - elif cc.check_header('gssapi.h', args: test_c_args, dependencies: gssapi, required: gssapiopt) + elif cc.check_header('gssapi.h', dependencies: gssapi, required: gssapiopt, + args: test_c_args, include_directories: postgres_inc) cdata.set('HAVE_GSSAPI_H', 1) else have_gssapi = false @@ -631,7 +632,8 @@ if not gssapiopt.disabled() elif cc.check_header('gssapi/gssapi_ext.h', dependencies: gssapi, required: false, args: test_c_args, include_directories: postgres_inc) cdata.set('HAVE_GSSAPI_GSSAPI_EXT_H', 1) - elif cc.check_header('gssapi_ext.h', args: test_c_args, dependencies: gssapi, required: gssapiopt) + elif cc.check_header('gssapi_ext.h', dependencies: gssapi, required: gssapiopt, + args: test_c_args, include_directories: postgres_inc) cdata.set('HAVE_GSSAPI_EXT_H', 1) else have_gssapi = false -- 2.44.0.279.g3bd955d269 --ps22nm2377upipkw Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0002-Don-t-define-HAVE_-GSSAPI_-GSSAPI_EXT_H.patch" From 9f7c96dfab4d807e668c9d32b44db5f4ff122e15 Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Mon, 8 Jul 2024 15:55:56 -0700 Subject: [PATCH v1 2/2] Don't define HAVE_[GSSAPI_]GSSAPI_EXT_H The check for gssapi_ext.h was added in f7431bca8b0. As we require gssapi_ext.h to be present, there's no point in defining symbols for the header presence. While at it, use cc.has_header() instead of cc.check_header(), that's a bit cheaper and it seems improbably that gssapi.h would compile while gssapi_ext.h would not. Author: Reviewed-by: Discussion: https://postgr.es/m/ Backpatch: --- meson.build | 15 ++++----------- configure.ac | 4 ++-- src/include/pg_config.h.in | 6 ------ configure | 12 ------------ 4 files changed, 6 insertions(+), 31 deletions(-) diff --git a/meson.build b/meson.build index 102b1e98a27..f1912d83ce6 100644 --- a/meson.build +++ b/meson.build @@ -620,25 +620,18 @@ if not gssapiopt.disabled() if not have_gssapi elif cc.check_header('gssapi/gssapi.h', dependencies: gssapi, required: false, args: test_c_args, include_directories: postgres_inc) + cc.has_header('gssapi/gssapi_ext.h', dependencies: gssapi, required: true, + args: test_c_args, include_directories: postgres_inc) cdata.set('HAVE_GSSAPI_GSSAPI_H', 1) elif cc.check_header('gssapi.h', dependencies: gssapi, required: gssapiopt, args: test_c_args, include_directories: postgres_inc) + cc.has_header('gssapi_ext.h', dependencies: gssapi, required: true, + args: test_c_args, include_directories: postgres_inc) cdata.set('HAVE_GSSAPI_H', 1) else have_gssapi = false endif - if not have_gssapi - elif cc.check_header('gssapi/gssapi_ext.h', dependencies: gssapi, required: false, - args: test_c_args, include_directories: postgres_inc) - cdata.set('HAVE_GSSAPI_GSSAPI_EXT_H', 1) - elif cc.check_header('gssapi_ext.h', dependencies: gssapi, required: gssapiopt, - args: test_c_args, include_directories: postgres_inc) - cdata.set('HAVE_GSSAPI_EXT_H', 1) - else - have_gssapi = false - endif - if not have_gssapi elif cc.has_function('gss_store_cred_into', dependencies: gssapi, args: test_c_args, include_directories: postgres_inc) diff --git a/configure.ac b/configure.ac index ab2d51c21ce..7cd7e95ae49 100644 --- a/configure.ac +++ b/configure.ac @@ -1532,8 +1532,8 @@ fi if test "$with_gssapi" = yes ; then AC_CHECK_HEADERS(gssapi/gssapi.h, [], [AC_CHECK_HEADERS(gssapi.h, [], [AC_MSG_ERROR([gssapi.h header file is required for GSSAPI])])]) - AC_CHECK_HEADERS(gssapi/gssapi_ext.h, [], - [AC_CHECK_HEADERS(gssapi_ext.h, [], [AC_MSG_ERROR([gssapi_ext.h header file is required for GSSAPI])])]) + AC_CHECK_HEADER(gssapi/gssapi_ext.h, [], + [AC_CHECK_HEADER(gssapi_ext.h, [], [AC_MSG_ERROR([gssapi_ext.h header file is required for GSSAPI])])]) fi PGAC_PATH_PROGS(OPENSSL, openssl) diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index f8d3e3b6b84..e0c0b51c5c1 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -180,12 +180,6 @@ /* Define to 1 if you have the `getpeerucred' function. */ #undef HAVE_GETPEERUCRED -/* Define to 1 if you have the header file. */ -#undef HAVE_GSSAPI_EXT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_GSSAPI_GSSAPI_EXT_H - /* Define to 1 if you have the header file. */ #undef HAVE_GSSAPI_GSSAPI_H diff --git a/configure b/configure index 76f06bd8fda..2a9d467be04 100755 --- a/configure +++ b/configure @@ -13677,32 +13677,20 @@ fi done - for ac_header in gssapi/gssapi_ext.h -do : ac_fn_c_check_header_mongrel "$LINENO" "gssapi/gssapi_ext.h" "ac_cv_header_gssapi_gssapi_ext_h" "$ac_includes_default" if test "x$ac_cv_header_gssapi_gssapi_ext_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GSSAPI_GSSAPI_EXT_H 1 -_ACEOF else - for ac_header in gssapi_ext.h -do : ac_fn_c_check_header_mongrel "$LINENO" "gssapi_ext.h" "ac_cv_header_gssapi_ext_h" "$ac_includes_default" if test "x$ac_cv_header_gssapi_ext_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GSSAPI_EXT_H 1 -_ACEOF else as_fn_error $? "gssapi_ext.h header file is required for GSSAPI" "$LINENO" 5 fi -done fi -done fi -- 2.44.0.279.g3bd955d269 --ps22nm2377upipkw--