From cd65c04269117f122fb1fb5c3d442d2ff84bf247 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Tue, 30 Apr 2024 15:52:25 +0000 Subject: [PATCH] import UBI rpm-4.16.1.3-29.el9 --- ...nd-document-rpmdb-verifydb-operation.patch | 148 ++++++++++++++++++ ...-help-description-of-whatconflicts-R.patch | 26 +++ ...ting-of-version-strings-in-expressio.patch | 50 ++++++ SPECS/rpm.spec | 20 ++- 4 files changed, 242 insertions(+), 2 deletions(-) create mode 100644 SOURCES/0001-Expose-and-document-rpmdb-verifydb-operation.patch create mode 100644 SOURCES/0001-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch create mode 100644 SOURCES/0001-Fix-short-circuiting-of-version-strings-in-expressio.patch diff --git a/SOURCES/0001-Expose-and-document-rpmdb-verifydb-operation.patch b/SOURCES/0001-Expose-and-document-rpmdb-verifydb-operation.patch new file mode 100644 index 0000000..23b444a --- /dev/null +++ b/SOURCES/0001-Expose-and-document-rpmdb-verifydb-operation.patch @@ -0,0 +1,148 @@ +From 173b737f40e7da85f79544e3f4ea4ad7b8f7d5c2 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Mon, 6 Nov 2023 15:58:54 +0200 +Subject: [PATCH] Expose and document rpmdb --verifydb operation + +After years of BDB, sometimes folks just want some assurance that their db +is still fine. Properly exposing an operation to do so hopefully makes +less likely to poke at the db directly (with eg sqlite3 command). +--- + docs/man/rpmdb.8.md | 4 ++++ + tools/rpmdb.c | 4 ++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/rpmdb.c b/rpmdb.c +index 22b0b3e5d..36efff8af 100644 +--- a/rpmdb.c ++++ b/rpmdb.c +@@ -23,8 +23,8 @@ static struct poptOption dbOptsTable[] = { + { "rebuilddb", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR), &mode, MODE_REBUILDDB, + N_("rebuild database inverted lists from installed package headers"), + NULL}, +- { "verifydb", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR|POPT_ARGFLAG_DOC_HIDDEN), +- &mode, MODE_VERIFYDB, N_("verify database files"), NULL}, ++ { "verifydb", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR), ++ &mode, MODE_VERIFYDB, N_("verify database"), NULL}, + { "salvagedb", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR|POPT_ARGFLAG_DOC_HIDDEN), + &mode, MODE_SALVAGEDB, N_("salvage database"), NULL}, + { "exportdb", '\0', (POPT_ARG_VAL|POPT_ARGFLAG_OR), &mode, MODE_EXPORTDB, +-- +2.41.0 + +--- a/doc/rpmdb.8 2020-05-28 12:04:25.024136615 +0200 ++++ b/doc/rpmdb.8 2023-12-13 11:57:30.646202901 +0100 +@@ -1,48 +1,70 @@ +-.TH "RPMDB" "8" "29 June 2010" "Red Hat, Inc" ++.\" Automatically generated by Pandoc 3.1.3 ++.\" ++.\" Define V font for inline verbatim, using C font in formats ++.\" that render this, and otherwise B font. ++.ie "\f[CB]x\f[]"x" \{\ ++. ftr V B ++. ftr VI BI ++. ftr VB B ++. ftr VBI BI ++.\} ++.el \{\ ++. ftr V CR ++. ftr VI CI ++. ftr VB CB ++. ftr VBI CBI ++.\} ++.TH "RPMDB" "8" "29 June 2010" "" "" ++.hy + .SH NAME +-rpmdb \- RPM Database Tool ++.PP ++rpmdb - RPM Database Tool + .SH SYNOPSIS +- +-\fBrpm\fR {\fB--initdb|--rebuilddb\fR} +- +-.SH "DESCRIPTION" +-The general form of an rpm rebuild database command is +-.PP +- +-\fBrpm\fR {\fB--initdb|--rebuilddb\fR} [\fB-v\fR] [\fB--dbpath \fIDIRECTORY\fB\fR] [\fB--root \fIDIRECTORY\fB\fR] +- +-.PP +-Use \fB--initdb\fR to create a new database if one doesn't already exist +-(existing database is not overwritten), use +-\fB--rebuilddb\fR to rebuild the database indices from +-the installed package headers. +-.PP +- +-.SH "SEE ALSO" +- +-.nf +-\fBpopt\fR(3), +-\fBrpm\fR(8), +-\fBrpmkeys\fR(8), +-\fBrpmsign\fR(8), +-\fBrpm2cpio\fR(8), +-\fBrpmbuild\fR(8), +-\fBrpmspec\fR(8), +-.fi +- +-\fBrpm --help\fR - as rpm supports customizing the options via popt aliases +-it's impossible to guarantee that what's described in the manual matches +-what's available. +- +- +-\fBhttp://www.rpm.org/ +-\fR +-.SH "AUTHORS" +- ++.PP ++\f[B]rpmdb\f[R] {\f[B]--initdb|--rebuilddb\f[R]} ++.PP ++\f[B]rpmdb\f[R] {\f[B]--verifydb\f[R]} ++.PP ++\f[B]rpmdb\f[R] {\f[B]--exportdb|--importdb\f[R]} ++.SH DESCRIPTION ++.PP ++The general form of an rpmdb command is ++.PP ++\f[B]rpm\f[R] {\f[B]--initdb|--rebuilddb\f[R]} [\f[B]-v\f[R]] ++[\f[B]--dbpath \f[R]\f[I]DIRECTORY\f[R]] [\f[B]--root ++\f[R]\f[I]DIRECTORY\f[R]] ++.PP ++Use \f[B]--initdb\f[R] to create a new database if one doesn\[aq]t ++already exist (existing database is not overwritten), use ++\f[B]--rebuilddb\f[R] to rebuild the database indices from the installed ++package headers. ++.PP ++\f[B]--verifydb\f[R] performs a low-level integrity check on the ++database. ++.PP ++\f[B]--exportdb\f[R] exports the database in header-list format, ++suitable for transfporting to another host or database type. ++.PP ++\f[B]--importdb\f[R] imports a database from a header-list format as ++created by \f[B]--exportdb\f[R]. ++.SH SEE ALSO ++.PP ++\f[B]popt\f[R](3), \f[B]rpm\f[R](8), \f[B]rpmkeys\f[R](8), ++\f[B]rpmsign\f[R](8), \f[B]rpm2cpio\f[R](8), \f[B]rpmbuild\f[R](8), ++\f[B]rpmspec\f[R](8) ++.PP ++\f[B]rpm --help\f[R] - as rpm supports customizing the options via popt ++aliases it\[aq]s impossible to guarantee that what\[aq]s described in ++the manual matches what\[aq]s available. ++.PP ++\f[B]http://www.rpm.org/ \f[R] ++.SH AUTHORS ++.IP + .nf +-Marc Ewing +-Jeff Johnson +-Erik Troan +-Panu Matilainen ++\f[C] ++Marc Ewing ++Jeff Johnson ++Erik Troan ++Panu Matilainen ++\f[R] + .fi +- diff --git a/SOURCES/0001-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch b/SOURCES/0001-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch new file mode 100644 index 0000000..63cc183 --- /dev/null +++ b/SOURCES/0001-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch @@ -0,0 +1,26 @@ +From 03525592c944957f3b7b200b7daeb9f615cdcde7 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Tue, 23 May 2023 12:46:22 +0300 +Subject: [PATCH] Fix a copy-paste --help description of --whatconflicts + (RhBug:2208661) + +--- + lib/poptQV.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/poptQV.c b/lib/poptQV.c +index ac8e8975d..8bd91c652 100644 +--- a/lib/poptQV.c ++++ b/lib/poptQV.c +@@ -108,7 +108,7 @@ struct poptOption rpmQVSourcePoptTable[] = { + { "verify", 'V', POPT_ARGFLAG_DOC_HIDDEN, NULL, 'V', + N_("rpm verify mode"), NULL }, + { "whatconflicts", '\0', 0, 0, POPT_WHATCONFLICTS, +- N_("query/verify the package(s) which require a dependency"), "CAPABILITY" }, ++ N_("query/verify the package(s) which conflict with a dependency"), "CAPABILITY" }, + { "whatrequires", '\0', 0, 0, POPT_WHATREQUIRES, + N_("query/verify the package(s) which require a dependency"), "CAPABILITY" }, + { "whatobsoletes", '\0', 0, 0, POPT_WHATOBSOLETES, +-- +2.41.0 + diff --git a/SOURCES/0001-Fix-short-circuiting-of-version-strings-in-expressio.patch b/SOURCES/0001-Fix-short-circuiting-of-version-strings-in-expressio.patch new file mode 100644 index 0000000..e06709a --- /dev/null +++ b/SOURCES/0001-Fix-short-circuiting-of-version-strings-in-expressio.patch @@ -0,0 +1,50 @@ +From 321933f060896f721e361a1c8a8d3731bdcee827 Mon Sep 17 00:00:00 2001 +From: Michael Schroeder +Date: Wed, 22 Jun 2022 14:07:01 +0200 +Subject: [PATCH] Fix short circuiting of version strings in expressions + +We use an empty string when discarding a value due to short circuiting, but +an empty string is not allowed for versions. So use "0" in that case. + +Fixes: #1883 +--- + rpmio/expression.c | 2 +- + tests/rpmmacro.at | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/rpmio/expression.c b/rpmio/expression.c +index a389a04d5..98a44bbdb 100644 +--- a/rpmio/expression.c ++++ b/rpmio/expression.c +@@ -477,7 +477,7 @@ static int rdToken(ParseState state) + if (qtok == TOK_STRING) { + v = valueMakeString(temp); + } else { +- v = valueMakeVersion(temp); ++ v = valueMakeVersion(state->flags & RPMEXPR_DISCARD ? "0" : temp); + free(temp); /* version doesn't take ownership of the string */ + if (v == 0) { + exprErr(state, _("invalid version"), p+1); +diff --git a/tests/rpmmacro.at b/tests/rpmmacro.at +index d1490b4d9..c4376d49e 100644 +--- a/tests/rpmmacro.at ++++ b/tests/rpmmacro.at +@@ -533,6 +533,7 @@ runroot rpm \ + --eval '%["%{aaa}"]' \ + --eval '%[%{?ccc}]' \ + --eval '%[v"1:2.3-4"]' \ ++ --eval '%[v"0" && v"0"]' \ + ]], + [0], + [4096 +@@ -542,6 +543,7 @@ runroot rpm \ + 5 + 0 + 1:2.3-4 ++0 + ], + []) + AT_CLEANUP +-- +2.41.0 + diff --git a/SPECS/rpm.spec b/SPECS/rpm.spec index 3ecdae5..2aba89e 100644 --- a/SPECS/rpm.spec +++ b/SPECS/rpm.spec @@ -32,7 +32,7 @@ %global rpmver 4.16.1.3 #global snapver rc1 -%global rel 27 +%global rel 29 %global sover 9 %global srcver %{rpmver}%{?snapver:-%{snapver}} @@ -105,6 +105,10 @@ Patch132: 0001-Fix-wrong-return-code-on-O_DIRECTORY-open-of-invalid.patch Patch133: 0001-Print-full-path-if-file-removal-fails.patch Patch134: 0001-Don-t-warn-about-missing-user-group-on-skipped-files.patch +Patch140: 0001-Fix-short-circuiting-of-version-strings-in-expressio.patch +Patch141: 0001-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch +Patch142: 0001-Expose-and-document-rpmdb-verifydb-operation.patch + # These are not yet upstream Patch906: rpm-4.7.1-geode-i686.patch # Probably to be upstreamed in slightly different form @@ -653,8 +657,20 @@ fi %doc doc/librpm/html/* %changelog +* Wed Dec 13 2023 Florian Festi - 4.16.1.3-29 +- Actually add --verifydb to the man page (RHEL-14591) +- Don't warn about missing user/group on skipped files (RHEL-18037) -* Mon Dec 11 2023 Florian Festi - 4.16.1.3-27 +* Mon Dec 11 2023 Florian Festi - 4.16.1.3-28 +- Fix warning if file removal fails + +* Mon Nov 27 2023 Florian Festi - 4.16.1.3-27 +- Fix short circuiting of version strings in expressions (RHEL-15688) +- Fix description of whatconflicts in the man page (RHEL-6303) +- Expose and document rpmdb --verifydb operation (RHEL-14591) +- Fixes to the file handling backport + +* Fri Nov 10 2023 Florian Festi - 4.16.1.3-26 - Backport file handling code from rpm-4.19 to fix CVE-2021-35937, CVE-2021-35938 and CVE-2021-35939