Compare commits

...
Sign in to create a new pull request.

7 commits

Author SHA1 Message Date
Packit
1708efb033 Update to 16.9 upstream release
- Resolves: rhbz#2365100

Commit authored by Packit automation (https://packit.dev/)
2025-05-08 14:35:16 +00:00
Packit
819ccc1fc8 Update to 16.8 upstream release
- Resolves: rhbz#2282749

Commit authored by Packit automation (https://packit.dev/)
2025-02-26 06:47:41 +00:00
Filip Janus
b9aafbc6e5 enable packit - add helper script 2025-02-26 06:39:53 +00:00
Filip Janus
7c76ca609f Add Obsoletes: postgresqlXX to make the upgrade path from alternative version clear 2024-08-07 10:30:48 +02:00
Ales Nezbeda
5301b9d504 Merge branch 'rawhide' into f40 2024-05-23 18:46:22 +02:00
Ales Nezbeda
fd223a2f99 Update to 16.3 and 15.7
LibXML and OpenSSL patches no longer needed.
2024-05-23 16:58:51 +02:00
Filip Janus
a66fd19064 Since /var/run/postgresql is symlink to /run/postgresql it could be removed.
Its not necessary to install /var/run/postgresql directory
because /run/postgresql is created by systemd script
Upstream rpm also deals only with /run
https://git.postgresql.org/gitweb/?p=pgrpms.git;a=blob;f=rpm/redhat/main/non-common/postgresql-16/main/postgresql-16.spec;h=93ebd0a0cfe52cf49cdf8b7bd18c3277c9df9402;hb=HEAD#l1179
Related:RHEL-25756
2024-02-28 12:24:49 +01:00
8 changed files with 38 additions and 230 deletions

8
.gitignore vendored
View file

@ -3,3 +3,11 @@
/postgresql-16.1.tar.bz2
/postgresql-16.1.tar.bz2.sha256
/postgresql-setup-8.9.tar.gz
/postgresql-15.7.tar.bz2
/postgresql-16.3.tar.bz2
/postgresql-15.7.tar.bz2.sha256
/postgresql-16.3.tar.bz2.sha256
/postgresql-16.8.tar.bz2
/postgresql-15.12.tar.bz2
/postgresql-16.8.tar.bz2.sha256
/postgresql-15.12.tar.bz2.sha256

3
README.packit Normal file
View file

@ -0,0 +1,3 @@
This repository is maintained by packit.
https://packit.dev/
The file was generated using packit 1.6.0.post1.dev2+gd5a7662a.

8
packit-update-sources.sh Executable file
View file

@ -0,0 +1,8 @@
git clone --depth 1 --branch master https://github.com/postgres/postgres.git
pushd postgres
git fetch --tags
NEW_MINOR=$(git tag -l "REL_15_*" | sed -E "s/REL_15_([0-9]+)/\1/" | sort -n | tail -n 1)
popd
pushd $PACKIT_DOWNSTREAM_REPO
sed -i "s/\(%global prevversion %{prevmajorversion}\)\.[0-9]\+/\1.$NEW_MINOR/" $PACKIT_DOWNSTREAM_PACKAGE_NAME.spec
popd

View file

@ -1,37 +0,0 @@
Fixes for GCC 14 and libxml2 2.12.0 "error: Make more xmlError structs constant"
xml.c: In function pg_xml_init:
xml.c:1177:52: error: passing argument 2 of xmlSetStructuredErrorFunc from incompatible pointer type [-Wincompatible-pointer-types]
1177 | xmlSetStructuredErrorFunc((void *) errcxt, xml_errorHandler);
| ^~~~~~~~~~~~~~~~
| |
| void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
In file included from /usr/include/libxml2/libxml/valid.h:15,
from /usr/include/libxml2/libxml/parser.h:19,
from xml.c:50:
/usr/include/libxml2/libxml/xmlerror.h:898:57: note: expected xmlStructuredErrorFunc {aka void (*)(void *, const struct _xmlError *)} but argument is of type void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
898 | xmlStructuredErrorFunc handler);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index d3db75eb87..619f908c6d 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -124,7 +124,7 @@ static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt);
static void xml_errsave(Node *escontext, PgXmlErrorContext *errcxt,
int sqlcode, const char *msg);
-static void xml_errorHandler(void *data, xmlErrorPtr error);
+static void xml_errorHandler(void *data, const xmlError *error);
static int errdetail_for_xml_code(int code);
static void chopStringInfoNewlines(StringInfo str);
static void appendStringInfoLineSeparator(StringInfo str);
@@ -2044,7 +2044,7 @@ xml_errsave(Node *escontext, PgXmlErrorContext *errcxt,
* Error handler for libxml errors and warnings
*/
static void
-xml_errorHandler(void *data, xmlErrorPtr error)
+xml_errorHandler(void *data, const xmlError *error)
{
PgXmlErrorContext *xmlerrcxt = (PgXmlErrorContext *) data;
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) error->ctxt;

View file

@ -1,142 +0,0 @@
Backport of commit b2b1f12882fb561c7d474b834044dd8ed570bfea to 16.1
Use BIO_{get,set}_app_data instead of BIO_{get,set}_data.
We should have done it this way all along, but we accidentally got
away with using the wrong BIO field up until OpenSSL 3.2. There,
the library's BIO routines that we rely on use the "data" field
for their own purposes, and our conflicting use causes assorted
weird behaviors up to and including core dumps when SSL connections
are attempted. Switch to using the approved field for the purpose,
i.e. app_data.
While at it, remove our configure probes for BIO_get_data as well
as the fallback implementation. BIO_{get,set}_app_data have been
there since long before any OpenSSL version that we still support,
even in the back branches.
Also, update src/test/ssl/t/001_ssltests.pl to allow for a minor
change in an error message spelling that evidently came in with 3.2.
Tristan Partin and Bo Andreson. Back-patch to all supported branches.
Discussion: https://postgr.es/m/CAN55FZ1eDDYsYaL7mv+oSLUij2h_u6hvD4Qmv-7PK7jkji0uyQ@mail.gmail.com
---
diff --git a/src/backend/libpq/be-secure-openssl.c b/src/backend/libpq/be-secure-openssl.c
index 31b6a6eacdf0..1b8b32c5b39e 100644
--- a/src/backend/libpq/be-secure-openssl.c
+++ b/src/backend/libpq/be-secure-openssl.c
@@ -842,11 +842,6 @@ be_tls_write(Port *port, void *ptr, size_t len, int *waitfor)
* to retry; do we need to adopt their logic for that?
*/
-#ifndef HAVE_BIO_GET_DATA
-#define BIO_get_data(bio) (bio->ptr)
-#define BIO_set_data(bio, data) (bio->ptr = data)
-#endif
-
static BIO_METHOD *my_bio_methods = NULL;
static int
@@ -856,7 +851,7 @@ my_sock_read(BIO *h, char *buf, int size)
if (buf != NULL)
{
- res = secure_raw_read(((Port *) BIO_get_data(h)), buf, size);
+ res = secure_raw_read(((Port *) BIO_get_app_data(h)), buf, size);
BIO_clear_retry_flags(h);
if (res <= 0)
{
@@ -876,7 +871,7 @@ my_sock_write(BIO *h, const char *buf, int size)
{
int res = 0;
- res = secure_raw_write(((Port *) BIO_get_data(h)), buf, size);
+ res = secure_raw_write(((Port *) BIO_get_app_data(h)), buf, size);
BIO_clear_retry_flags(h);
if (res <= 0)
{
@@ -952,7 +947,7 @@ my_SSL_set_fd(Port *port, int fd)
SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB);
goto err;
}
- BIO_set_data(bio, port);
+ BIO_set_app_data(bio, port);
BIO_set_fd(bio, fd, BIO_NOCLOSE);
SSL_set_bio(port->ssl, bio, bio);
diff --git a/src/interfaces/libpq/fe-secure-openssl.c b/src/interfaces/libpq/fe-secure-openssl.c
index 4aeaf08312ce..e669bdbf1d2d 100644
--- a/src/interfaces/libpq/fe-secure-openssl.c
+++ b/src/interfaces/libpq/fe-secure-openssl.c
@@ -1815,11 +1815,6 @@ PQsslAttribute(PGconn *conn, const char *attribute_name)
* to retry; do we need to adopt their logic for that?
*/
-#ifndef HAVE_BIO_GET_DATA
-#define BIO_get_data(bio) (bio->ptr)
-#define BIO_set_data(bio, data) (bio->ptr = data)
-#endif
-
static BIO_METHOD *my_bio_methods;
static int
@@ -1828,7 +1823,7 @@ my_sock_read(BIO *h, char *buf, int size)
{
int res;
- res = pqsecure_raw_read((PGconn *) BIO_get_data(h), buf, size);
+ res = pqsecure_raw_read((PGconn *) BIO_get_app_data(h), buf, size);
BIO_clear_retry_flags(h);
if (res < 0)
{
@@ -1858,7 +1853,7 @@ my_sock_write(BIO *h, const char *buf, int size)
{
int res;
- res = pqsecure_raw_write((PGconn *) BIO_get_data(h), buf, size);
+ res = pqsecure_raw_write((PGconn *) BIO_get_app_data(h), buf, size);
BIO_clear_retry_flags(h);
if (res < 0)
{
@@ -1968,7 +1963,7 @@ my_SSL_set_fd(PGconn *conn, int fd)
SSLerr(SSL_F_SSL_SET_FD, ERR_R_BUF_LIB);
goto err;
}
- BIO_set_data(bio, conn);
+ BIO_set_app_data(bio, conn);
SSL_set_bio(conn->ssl, bio, bio);
BIO_set_fd(bio, fd, BIO_NOCLOSE);
diff --git a/src/test/ssl/t/001_ssltests.pl b/src/test/ssl/t/001_ssltests.pl
index a049fd2ff03a..d921f1dde9fa 100644
--- a/src/test/ssl/t/001_ssltests.pl
+++ b/src/test/ssl/t/001_ssltests.pl
@@ -776,7 +776,7 @@ sub switch_server_cert
"$common_connstr user=ssltestuser sslcert=ssl/client-revoked.crt "
. sslkey('client-revoked.key'),
"certificate authorization fails with revoked client cert",
- expected_stderr => qr/SSL error: sslv3 alert certificate revoked/,
+ expected_stderr => qr|SSL error: ssl[a-z0-9/]* alert certificate revoked|,
# temporarily(?) skip this check due to timing issue
# log_like => [
# qr{Client certificate verification failed at depth 0: certificate revoked},
@@ -881,7 +881,7 @@ sub switch_server_cert
"$common_connstr user=ssltestuser sslcert=ssl/client-revoked.crt "
. sslkey('client-revoked.key'),
"certificate authorization fails with revoked client cert with server-side CRL directory",
- expected_stderr => qr/SSL error: sslv3 alert certificate revoked/,
+ expected_stderr => qr|SSL error: ssl[a-z0-9/]* alert certificate revoked|,
# temporarily(?) skip this check due to timing issue
# log_like => [
# qr{Client certificate verification failed at depth 0: certificate revoked},
@@ -894,7 +894,7 @@ sub switch_server_cert
"$common_connstr user=ssltestuser sslcert=ssl/client-revoked-utf8.crt "
. sslkey('client-revoked-utf8.key'),
"certificate authorization fails with revoked UTF-8 client cert with server-side CRL directory",
- expected_stderr => qr/SSL error: sslv3 alert certificate revoked/,
+ expected_stderr => qr|SSL error: ssl[a-z0-9/]* alert certificate revoked|,
# temporarily(?) skip this check due to timing issue
# log_like => [
# qr{Client certificate verification failed at depth 0: certificate revoked},

View file

@ -1,37 +0,0 @@
Fixes for GCC 14 and libxml2 2.12.0 "error: Make more xmlError structs constant"
xml.c: In function pg_xml_init:
xml.c:1177:52: error: passing argument 2 of xmlSetStructuredErrorFunc from incompatible pointer type [-Wincompatible-pointer-types]
1177 | xmlSetStructuredErrorFunc((void *) errcxt, xml_errorHandler);
| ^~~~~~~~~~~~~~~~
| |
| void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
In file included from /usr/include/libxml2/libxml/valid.h:15,
from /usr/include/libxml2/libxml/parser.h:19,
from xml.c:50:
/usr/include/libxml2/libxml/xmlerror.h:898:57: note: expected xmlStructuredErrorFunc {aka void (*)(void *, const struct _xmlError *)} but argument is of type void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
898 | xmlStructuredErrorFunc handler);
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index 6411f56b99..0eb39fcfc2 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -119,7 +119,7 @@ struct PgXmlErrorContext
static xmlParserInputPtr xmlPgEntityLoader(const char *URL, const char *ID,
xmlParserCtxtPtr ctxt);
-static void xml_errorHandler(void *data, xmlErrorPtr error);
+static void xml_errorHandler(void *data, const xmlError *error);
static void xml_ereport_by_code(int level, int sqlcode,
const char *msg, int errcode);
static void chopStringInfoNewlines(StringInfo str);
@@ -1749,7 +1749,7 @@ xml_ereport(PgXmlErrorContext *errcxt, int level, int sqlcode, const char *msg)
* Error handler for libxml errors and warnings
*/
static void
-xml_errorHandler(void *data, xmlErrorPtr error)
+xml_errorHandler(void *data, const xmlError *error)
{
PgXmlErrorContext *xmlerrcxt = (PgXmlErrorContext *) data;
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) error->ctxt;

View file

@ -47,8 +47,8 @@
Summary: PostgreSQL client programs
Name: %{majorname}%{majorversion}
Version: %{majorversion}.1
Release: 7%{?dist}
Version: %{majorversion}.8
Release: 1%{?dist}
# The PostgreSQL license is very similar to other MIT licenses, but the OSI
# recognizes it as an independent license, so we do as well.
@ -60,7 +60,7 @@ Url: http://www.postgresql.org/
# that this be kept up with the latest minor release of the previous series;
# but update when bugs affecting pg_dump output are fixed.
%global prevmajorversion 15
%global prevversion %{prevmajorversion}.5
%global prevversion %{prevmajorversion}.12
%global prev_prefix %{_libdir}/pgsql/postgresql-%{prevmajorversion}
%global precise_version %{?epoch:%epoch:}%version-%release
@ -95,9 +95,6 @@ Patch9: postgresql-server-pg_config.patch
# rhbz#1940964
Patch10: postgresql-datalayout-mismatch-on-s390.patch
Patch12: postgresql-no-libecpg.patch
Patch13: postgresql-libxml2.patch
Patch14: postgresql15-libxml2.patch
Patch15: postgresql-openssl32.patch
# This macro is used for package names in the files section
%if %?postgresql_default
@ -180,6 +177,7 @@ BuildRequires: libicu-devel
%define postgresqlXX_if_default() %{expand:\
Provides: postgresql%{majorversion}%{?1:-%{1}} = %precise_version\
Provides: postgresql%{majorversion}%{?1:-%{1}}%{?_isa} = %precise_version\
Obsoletes: postgresql%{majorversion}%{?1:-%{1}}\
}
%else
%define postgresqlXX_if_default() %{nil}
@ -520,8 +518,6 @@ goal of accelerating analytics queries.
%endif
%patch 9 -p1
%patch 10 -p1
%patch 13 -p1
%patch 15 -p1
%if ! %external_libpq
@ -538,8 +534,6 @@ tar xfj %{SOURCE3}
find . -type f -name Makefile -exec sed -i -e "s/SO_MAJOR_VERSION=\s\?\([0-9]\+\)/SO_MAJOR_VERSION= %{private_soname}-\1/" {} \;
%endif
%patch 14 -p1 -d postgresql-%{prevversion}
# apply once SOURCE3 is extracted
%endif
@ -1195,6 +1189,9 @@ make -C postgresql-setup-%{setup_version} check
%{_datadir}/pgsql/system_constraints.sql
%{_datadir}/pgsql/system_functions.sql
%{_datadir}/pgsql/system_views.sql
%{_datadir}/pgsql/fix-CVE-2024-4317.sql
%{_datadir}/pgsql/timezonesets/
%{_datadir}/pgsql/tsearch_data/
%dir %{_datadir}/postgresql-setup
@ -1334,6 +1331,14 @@ make -C postgresql-setup-%{setup_version} check
%changelog
* Wed Feb 26 2025 Packit <hello@packit.dev> - 16.8-1
- Update to version 16.8
- Resolves: rhbz#2282749
* Mon Aug 05 2024 Filip Janus <fjanus@redhat.com> - 16.3-8
- Add Obsoletes of versioned alternative stream from F39
- It makes the upgrade path clear
* Mon Feb 26 2024 Filip Janus <fjanus@redhat.com> - 16.1-7
- Remove /var/run/postgresql

8
sources Executable file → Normal file
View file

@ -1,5 +1,5 @@
SHA512 (postgresql-15.5.tar.bz2) = 9ed9d160b3cef99954ccd47a970c107b7e3b0196a7d848f740bf3c52a1c626f6f457814c97f37b9f0467bb07734e19806a15bd9cf3c39445e1d89e75b37064cc
SHA512 (postgresql-15.5.tar.bz2.sha256) = 896ad3a1952f54bc5186d49eb4faec40843813d3e1c200f7b27f0e099b426ef9b59e0c15cb5453ac166e8a566b24178b95836776207de0bf19f5e021fdccfbca
SHA512 (postgresql-16.1.tar.bz2) = 69f4635e5841452599f13b47df41ce2425ab34b4e4582fd2c635bc78d561fa36c5b03eccb4ae6569872dc74775be1b5a62dee20c9a4f12a43339250128352918
SHA512 (postgresql-16.1.tar.bz2.sha256) = 3f573d81a7af02dea2a3eee180d4e465546fc4d283dde5b6627d25af0be4a546ffd3ae914dd3490e45264d1a43cf143e829e14e5cd9c6bd8f179b6eae4fd6ff1
SHA512 (postgresql-16.8.tar.bz2) = f44fdfe01fbf82f3ffe4c9fc860bd27e06dddfe43b6bd6d1c6e267d64086eb5517e23cc1b2b8895cb73e63fce76779993ea9785a97e6e348ed91b4c08bb0492d
SHA512 (postgresql-15.12.tar.bz2) = 6ccb44cb7ff2133ccb03dfc6b49e26714d9aecb91f4b9d019a8f1e7d0d71ed0bf8101fbbda0185091e4688a557600f020a12306c389e819d731184c17e182717
SHA512 (postgresql-setup-8.9.tar.gz) = 118e9ebf858722a38b0e90324bc1b49fc7058cda601ca0a7e78c94e7b95e89d6dbbc46f377626364b068614ced3cde3cb4733973ad2d71bf17892ad773657ef7
SHA512 (postgresql-16.8.tar.bz2.sha256) = 878f5b5d71a10de9416bdd74bef034efade87cc9d6fad6ce1491842ab6415f897c715a2817552f627744ab23cf2a8287010d5e2e2f1c9206e563a1d0e26d39cc
SHA512 (postgresql-15.12.tar.bz2.sha256) = b0965f1a4a5baf304eb7cfc279a8cdbe58e6036635757cb5674699d9f46072b05bb41618e3afba76ec384670f4806fc12879dd8bb050cbff54468a0c91b634e7