Skip to content

Commit

Permalink
[AUTO-CHERRYPICK] postgresql: update to version14.11 to fix CVE-2024-…
Browse files Browse the repository at this point in the history
…0985 - branch main (#8161)
  • Loading branch information
CBL-Mariner-Bot authored Feb 28, 2024
1 parent 8bae98a commit 317bacf
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 15 deletions.
6 changes: 3 additions & 3 deletions SPECS/postgresql/postgresql.signatures.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"Signatures": {
"postgresql-14.10.tar.bz2": "c99431c48e9d470b0d0ab946eb2141a3cd19130c2fb4dc4b3284a7774ecc8399"
"Signatures": {
"postgresql-14.11.tar.bz2": "a670bd7dce22dcad4297b261136b3b1d4a09a6f541719562aa14ca63bf2968a8"
}
}
}
43 changes: 33 additions & 10 deletions SPECS/postgresql/postgresql.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: PostgreSQL database engine
Name: postgresql
Version: 14.10
Version: 14.11
Release: 1%{?dist}
License: PostgreSQL
Vendor: Microsoft Corporation
Expand Down Expand Up @@ -35,6 +35,12 @@ Requires: zlib
%description
PostgreSQL is an object-relational database management system.

%package docs
Summary: Extra documentation for PostgreSQL

%description docs
The postgresql-docs package includes the documentation.

%package libs
Summary: Libraries for use with PostgreSQL
Group: Applications/Databases
Expand Down Expand Up @@ -64,10 +70,11 @@ The postgresql-devel package contains libraries and header files for
developing applications that use postgresql.

%prep
%setup -q
%autosetup -p1

%build
sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h &&
sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_manual.h

./configure \
--enable-thread-safety \
--prefix=%{_prefix} \
Expand All @@ -78,13 +85,11 @@ sed -i '/DEFAULT_PGSOCKET_DIR/s@/tmp@/run/postgresql@' src/include/pg_config_man
--with-readline \
--with-system-tzdata=%{_datadir}/zoneinfo \
--docdir=%{_docdir}/postgresql
make -C ./src/backend generated-headers
make %{?_smp_mflags}
cd contrib && make %{?_smp_mflags}

%make_build world

%install
make install DESTDIR=%{buildroot}
cd contrib && make install DESTDIR=%{buildroot}
%make_install install-world

# For postgresql 10+, commands are renamed
# Ref: https://wiki.postgresql.org/wiki/New_in_postgres_10
Expand All @@ -93,9 +98,19 @@ ln -sf pg_resetwal %{buildroot}%{_bindir}/pg_resetxlog
ln -sf pg_waldump %{buildroot}%{_bindir}/pg_xlogdump
%{_fixperms} %{buildroot}/*

# Remove anything related to Python 2. These have no need to be
# around as only Python 3 is supported.
rm -f %{buildroot}%{_pgdatadir}/extension/*plpython2u* \
%{buildroot}%{_pgdatadir}/extension/*plpythonu-* \
%{buildroot}%{_pgdatadir}/extension/*_plpythonu.control

# Remove currently unnecessary man pages.
rm -f %{buildroot}%{_mandir}/man1/* \
%{buildroot}%{_mandir}/man3/* \
%{buildroot}%{_mandir}/man7/*

%check
sed -i '2219s/",/ ; EXIT_STATUS=$? ; sleep 5 ; exit $EXIT_STATUS",/g' src/test/regress/pg_regress.c
chown -Rv nobody .
chown -Rv nobody:nogroup .
sudo -u nobody -s /bin/bash -c "PATH=$PATH make -k check"

%ldconfig_scriptlets
Expand Down Expand Up @@ -133,6 +148,10 @@ sudo -u nobody -s /bin/bash -c "PATH=$PATH make -k check"
%exclude %{_datadir}/postgresql/pg_service.conf.sample
%exclude %{_datadir}/postgresql/psqlrc.sample

%files docs
%defattr(-,root,root)
%{_docdir}/postgresql/*

%files libs
%{_bindir}/clusterdb
%{_bindir}/createdb
Expand Down Expand Up @@ -172,6 +191,10 @@ sudo -u nobody -s /bin/bash -c "PATH=$PATH make -k check"
%{_libdir}/libpgtypes.a

%changelog
* Tue Feb 27 2024 Thien Trung Vuong <[email protected]> - 14.11-1
- Update to version 14.11 to fix CVE-2024-0985
- Added the 'docs' subpackage.

* Fri Dec 29 2023 Neha Agarwal <[email protected]> - 14.10-1
- Upgrade to 14.10 to fix CVE-2023-5868, CVE-2023-5869 and CVE-2023-5870

Expand Down
4 changes: 2 additions & 2 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -21454,8 +21454,8 @@
"type": "other",
"other": {
"name": "postgresql",
"version": "14.10",
"downloadUrl": "https://ftp.postgresql.org/pub/source/v14.10/postgresql-14.10.tar.bz2"
"version": "14.11",
"downloadUrl": "https://ftp.postgresql.org/pub/source/v14.11/postgresql-14.11.tar.bz2"
}
}
},
Expand Down

0 comments on commit 317bacf

Please sign in to comment.