Hello, hackers,

(there was no discussion of the recent CVE-related commits here,
starting a new thread)

In recent CVE-related commits there is one PGDLLIMPORT missing:

--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -228,6 +228,9 @@ extern void select_best_grantor(const RoleSpec *grantedBy, 
AclMode privileges,
                                const Acl *acl, Oid ownerId,
                                Oid *grantorId, AclMode *grantOptions);
+/* DATABASEOID syscache hash value for our own database, set by initialize_acl */
+extern uint32 cached_db_hash;
+
 extern void initialize_acl(void);
/*

see commit
ffca23839cc Invalidate plan cache after role changes. (2026-08-10) <Nathan Bossart>
and related backported commits.

But every non-static variable declaration in .h files must be declared PGDLLIMPORT since REL_15_STABLE and
8ec569479fc Apply PGDLLIMPORT markings broadly. (2022-04-08) <Robert Haas>
just to avoid keeping extension authors on Windows at a disadvantage, as it was discussed around that patch. Since there was no other extern variables in this header file, it's an easily understood thinko.

So I suggest an obvious fix, which is needed in REL_14_STABLE..master, attached.

P.S. Perhaps CI or buildfarm member running src/tools/mark_pgdllimport.pl would be a good idea?

P.P.S. CC to Nathan Bossart and Noah Misch as author and committer.
Best regards,
Anton Voloshin, postgrespro.com
From fea9fe0209e8f95a5067af8c1e496c8440ebc9e7 Mon Sep 17 00:00:00 2001
From: Anton Voloshin <[email protected]>
Date: Wed, 12 Aug 2026 11:20:47 +0300
Subject: [PATCH] add PGDLLIMPORT to the no-longer-static cached_db_hash in
 acl.h

It was made non-static in master commit
ffca23839cc Invalidate plan cache after role changes. (2026-08-10) <Nathan Bossart>
which was back-ported down to REL_14_STABLE..REL_19_STABLE
---
 src/include/utils/acl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index a16bf2fa15a..94439f2aed4 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -229,7 +229,7 @@ extern void select_best_grantor(const RoleSpec *grantedBy, AclMode privileges,
 								Oid *grantorId, AclMode *grantOptions);
 
 /* DATABASEOID syscache hash value for our own database, set by initialize_acl */
-extern uint32 cached_db_hash;
+extern PGDLLIMPORT uint32 cached_db_hash;
 
 extern void initialize_acl(void);
 
-- 
2.55.0

From bc00c74bb9643efb631b2047f89570129bb1fe5a Mon Sep 17 00:00:00 2001
From: Anton Voloshin <[email protected]>
Date: Wed, 12 Aug 2026 11:20:47 +0300
Subject: [PATCH] add PGDLLIMPORT to the no-longer-static cached_db_hash in
 acl.h

It was made non-static in master commit
ffca23839cc Invalidate plan cache after role changes. (2026-08-10) <Nathan Bossart>
which was back-ported down to REL_14_STABLE..REL_19_STABLE
---
 src/include/utils/acl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index a16bf2fa15a..94439f2aed4 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -229,7 +229,7 @@ extern void select_best_grantor(const RoleSpec *grantedBy, AclMode privileges,
 								Oid *grantorId, AclMode *grantOptions);
 
 /* DATABASEOID syscache hash value for our own database, set by initialize_acl */
-extern uint32 cached_db_hash;
+extern PGDLLIMPORT uint32 cached_db_hash;
 
 extern void initialize_acl(void);
 
-- 
2.55.0

From e2a3b1216191902f172a7386004507f1b7bfb451 Mon Sep 17 00:00:00 2001
From: Anton Voloshin <[email protected]>
Date: Wed, 12 Aug 2026 11:20:47 +0300
Subject: [PATCH] add PGDLLIMPORT to the no-longer-static cached_db_hash in
 acl.h

It was made non-static in master commit
ffca23839cc Invalidate plan cache after role changes. (2026-08-10) <Nathan Bossart>
which was back-ported down to REL_14_STABLE..REL_19_STABLE
---
 src/include/utils/acl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 13bb8128747..d1012008f34 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -228,7 +228,7 @@ extern void select_best_grantor(Oid roleId, AclMode privileges,
 								Oid *grantorId, AclMode *grantOptions);
 
 /* DATABASEOID syscache hash value for our own database, set by initialize_acl */
-extern uint32 cached_db_hash;
+extern PGDLLIMPORT uint32 cached_db_hash;
 
 extern void initialize_acl(void);
 
-- 
2.55.0

From fba877b5db14e54b5dcd838090dddf7e479275b1 Mon Sep 17 00:00:00 2001
From: Anton Voloshin <[email protected]>
Date: Wed, 12 Aug 2026 11:20:47 +0300
Subject: [PATCH] add PGDLLIMPORT to the no-longer-static cached_db_hash in
 acl.h

It was made non-static in master commit
ffca23839cc Invalidate plan cache after role changes. (2026-08-10) <Nathan Bossart>
which was back-ported down to REL_14_STABLE..REL_19_STABLE
---
 src/include/utils/acl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 96c906bab20..c3bcf2d4d1f 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -228,7 +228,7 @@ extern void select_best_grantor(Oid roleId, AclMode privileges,
 								Oid *grantorId, AclMode *grantOptions);
 
 /* DATABASEOID syscache hash value for our own database, set by initialize_acl */
-extern uint32 cached_db_hash;
+extern PGDLLIMPORT uint32 cached_db_hash;
 
 extern void initialize_acl(void);
 
-- 
2.55.0

From 67dafec690cbeae48489fc1ad6484c411f8f6ec0 Mon Sep 17 00:00:00 2001
From: Anton Voloshin <[email protected]>
Date: Wed, 12 Aug 2026 11:20:47 +0300
Subject: [PATCH] add PGDLLIMPORT to the no-longer-static cached_db_hash in
 acl.h

It was made non-static in master commit
ffca23839cc Invalidate plan cache after role changes. (2026-08-10) <Nathan Bossart>
which was back-ported down to REL_14_STABLE..REL_19_STABLE
---
 src/include/utils/acl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index 484883a79a5..329756393ee 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -227,7 +227,7 @@ extern void select_best_grantor(Oid roleId, AclMode privileges,
 								Oid *grantorId, AclMode *grantOptions);
 
 /* DATABASEOID syscache hash value for our own database, set by initialize_acl */
-extern uint32 cached_db_hash;
+extern PGDLLIMPORT uint32 cached_db_hash;
 
 extern void initialize_acl(void);
 
-- 
2.55.0

From ddac95cf107c7edd3eb10fe1dd810cb1d335e91a Mon Sep 17 00:00:00 2001
From: Anton Voloshin <[email protected]>
Date: Wed, 12 Aug 2026 11:20:47 +0300
Subject: [PATCH] add PGDLLIMPORT to the no-longer-static cached_db_hash in
 acl.h

It was made non-static in master commit
ffca23839cc Invalidate plan cache after role changes. (2026-08-10) <Nathan Bossart>
which was back-ported down to REL_14_STABLE..REL_19_STABLE
---
 src/include/utils/acl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index fd5c2db7b09..cd55a405857 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -225,7 +225,7 @@ extern void select_best_grantor(Oid roleId, AclMode privileges,
 								Oid *grantorId, AclMode *grantOptions);
 
 /* DATABASEOID syscache hash value for our own database, set by initialize_acl */
-extern uint32 cached_db_hash;
+extern PGDLLIMPORT uint32 cached_db_hash;
 
 extern void initialize_acl(void);
 
-- 
2.55.0

From 4c63b00b5fb91f45792d0d8b4eccf7182d282769 Mon Sep 17 00:00:00 2001
From: Anton Voloshin <[email protected]>
Date: Wed, 12 Aug 2026 11:20:47 +0300
Subject: [PATCH] add PGDLLIMPORT to the no-longer-static cached_db_hash in
 acl.h

It was made non-static in master commit
ffca23839cc Invalidate plan cache after role changes. (2026-08-10) <Nathan Bossart>
which was back-ported down to REL_14_STABLE..REL_19_STABLE
---
 src/include/utils/acl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/utils/acl.h b/src/include/utils/acl.h
index c3155caf729..385ae847f2a 100644
--- a/src/include/utils/acl.h
+++ b/src/include/utils/acl.h
@@ -222,7 +222,7 @@ extern void select_best_grantor(Oid roleId, AclMode privileges,
 								Oid *grantorId, AclMode *grantOptions);
 
 /* DATABASEOID syscache hash value for our own database, set by initialize_acl */
-extern uint32 cached_db_hash;
+extern PGDLLIMPORT uint32 cached_db_hash;
 
 extern void initialize_acl(void);
 
-- 
2.55.0

Reply via email to