be-gssapi-common.h should be located in src/include/libpq/
Hi all,
As mentioned on another thread about test coverage, I have noticed
that be-gssapi-common.h is not placed at the correct location, even
its its identication path at the top points to where the file should
be:
/messages/by-id/20190604014630.GH1529@paquier.xyz
The file has been introduced at its current location as of b0b39f72.
Any objections to something like the attached?
Thanks,
--
Michael
Attachments:
0001-Move-be-gssapi-common.h-into-src-include-libpq.patchtext/x-diff; charset=us-asciiDownload
From c77c7d052dc7046040a67382b9e55ab9c6a79f3f Mon Sep 17 00:00:00 2001
From: Michael Paquier <michael@paquier.xyz>
Date: Fri, 7 Jun 2019 13:20:39 +0900
Subject: [PATCH] Move be-gssapi-common.h into src/include/libpq/
---
src/backend/libpq/auth.c | 2 +-
src/backend/libpq/be-gssapi-common.c | 2 +-
src/backend/libpq/be-secure-gssapi.c | 2 +-
src/{backend => include}/libpq/be-gssapi-common.h | 0
4 files changed, 3 insertions(+), 3 deletions(-)
rename src/{backend => include}/libpq/be-gssapi-common.h (100%)
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index a7763f3f60..931058695a 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -173,7 +173,7 @@ bool pg_krb_caseins_users;
*----------------------------------------------------------------
*/
#ifdef ENABLE_GSS
-#include "be-gssapi-common.h"
+#include "libpq/be-gssapi-common.h"
static int pg_GSS_checkauth(Port *port);
static int pg_GSS_recvauth(Port *port);
diff --git a/src/backend/libpq/be-gssapi-common.c b/src/backend/libpq/be-gssapi-common.c
index e285a7061e..edb34026d4 100644
--- a/src/backend/libpq/be-gssapi-common.c
+++ b/src/backend/libpq/be-gssapi-common.c
@@ -14,7 +14,7 @@
#include "postgres.h"
-#include "be-gssapi-common.h"
+#include "libpq/be-gssapi-common.h"
/*
* Helper function for getting all strings of a GSSAPI error (of specified
diff --git a/src/backend/libpq/be-secure-gssapi.c b/src/backend/libpq/be-secure-gssapi.c
index b345eae62a..b1d5647e23 100644
--- a/src/backend/libpq/be-secure-gssapi.c
+++ b/src/backend/libpq/be-secure-gssapi.c
@@ -16,7 +16,7 @@
#include <unistd.h>
-#include "be-gssapi-common.h"
+#include "libpq/be-gssapi-common.h"
#include "libpq/auth.h"
#include "libpq/libpq.h"
#include "libpq/libpq-be.h"
diff --git a/src/backend/libpq/be-gssapi-common.h b/src/include/libpq/be-gssapi-common.h
similarity index 100%
rename from src/backend/libpq/be-gssapi-common.h
rename to src/include/libpq/be-gssapi-common.h
--
2.20.1
On 7 Jun 2019, at 06:34, Michael Paquier <michael@paquier.xyz> wrote:
Any objections to something like the attached?
No objections to moving the file per the patch.
While looking at libpq.h I noticed what seems to be a few nitpicks: the GSS
function prototype isn’t using the common format of having a comment specifying
the file it belongs to; ssl_loaded_verify_locations is defined as extern even
though it’s only available under USE_SSL (which works fine since it’s only
accessed under USE_SSL but seems kinda wrong); and FeBeWaitSet is not listed
under the pqcomm.c prototypes like how the extern vars from be-secure.c are.
All of these are in the attached.
cheers ./daniel
Attachments:
libpq_reorg.diffapplication/octet-stream; name=libpq_reorg.diff; x-unix-mode=0644Download
diff --git a/src/include/libpq/libpq.h b/src/include/libpq/libpq.h
index 79f0860823..08a257616d 100644
--- a/src/include/libpq/libpq.h
+++ b/src/include/libpq/libpq.h
@@ -53,6 +53,8 @@ extern const PGDLLIMPORT PQcommMethods *PqCommMethods;
/*
* prototypes for functions in pqcomm.c
*/
+extern WaitEventSet *FeBeWaitSet;
+
extern int StreamServerPort(int family, char *hostName,
unsigned short portNumber, char *unixSocketDir,
pgsocket ListenSocket[], int MaxListen);
@@ -83,6 +85,9 @@ extern char *ssl_crl_file;
extern char *ssl_dh_params_file;
extern char *ssl_passphrase_command;
extern bool ssl_passphrase_command_supports_reload;
+#ifdef USE_SSL
+extern bool ssl_loaded_verify_locations;
+#endif
extern int secure_initialize(bool isServerStart);
extern bool secure_loaded_verify_locations(void);
@@ -93,14 +98,14 @@ extern ssize_t secure_read(Port *port, void *ptr, size_t len);
extern ssize_t secure_write(Port *port, void *ptr, size_t len);
extern ssize_t secure_raw_read(Port *port, void *ptr, size_t len);
extern ssize_t secure_raw_write(Port *port, const void *ptr, size_t len);
+
+/*
+ * prototypes for functions in be-secure-gssapi.c
+ */
#ifdef ENABLE_GSS
extern ssize_t secure_open_gssapi(Port *port);
#endif
-extern bool ssl_loaded_verify_locations;
-
-extern WaitEventSet *FeBeWaitSet;
-
/* GUCs */
extern char *SSLCipherSuites;
extern char *SSLECDHCurve;
Greetings,
* Michael Paquier (michael@paquier.xyz) wrote:
As mentioned on another thread about test coverage, I have noticed
that be-gssapi-common.h is not placed at the correct location, even
its its identication path at the top points to where the file should
be:
/messages/by-id/20190604014630.GH1529@paquier.xyzThe file has been introduced at its current location as of b0b39f72.
Any objections to something like the attached?
I'm pretty sure it ended up there just because that's how things are in
src/interfaces/libpq. I don't have any objection to moving it, I had
really just been waiting to see where that thread ended up going.
On a quick look, the patch looks fine to me.
Thanks,
Stephen
On Fri, Jun 07, 2019 at 08:11:07AM -0400, Stephen Frost wrote:
I'm pretty sure it ended up there just because that's how things are in
src/interfaces/libpq. I don't have any objection to moving it, I had
really just been waiting to see where that thread ended up going.On a quick look, the patch looks fine to me.
OK thanks. I have committed this portion of the patch for now. If
there are any remaining issues let's take care of them afterwards.
--
Michael
On Fri, Jun 07, 2019 at 09:52:26AM +0200, Daniel Gustafsson wrote:
While looking at libpq.h I noticed what seems to be a few nitpicks: the GSS
function prototype isn’t using the common format of having a comment specifying
the file it belongs to; ssl_loaded_verify_locations is defined as extern even
though it’s only available under USE_SSL (which works fine since it’s only
accessed under USE_SSL but seems kinda wrong); and FeBeWaitSet is not listed
under the pqcomm.c prototypes like how the extern vars from be-secure.c are.
All of these are in the attached.
Indeed, this makes the header more consistent. Thanks for noticing.
--
Michael