Rebase to rpm 4.18.0 final

This commit is contained in:
Panu Matilainen 2022-09-21 13:24:24 +03:00
parent 293b446a51
commit 476a04e71a
5 changed files with 7 additions and 71 deletions

1
.gitignore vendored
View File

@ -54,3 +54,4 @@
/rpm-4.18.0-alpha2.tar.bz2
/rpm-4.18.0-beta1.tar.bz2
/rpm-4.18.0-rc1.tar.bz2
/rpm-4.18.0.tar.bz2

View File

@ -1,38 +0,0 @@
From f78be76a00878183da86d5e37ddbe421c5fe028c Mon Sep 17 00:00:00 2001
Message-Id: <f78be76a00878183da86d5e37ddbe421c5fe028c.1663150557.git.pmatilai@redhat.com>
From: Panu Matilainen <pmatilai@redhat.com>
Date: Wed, 14 Sep 2022 13:13:24 +0300
Subject: [PATCH] Fix a memory leak in the new directory dance in ensureDir()
This would leak the path whenever we already had the directory open.
Which happens a lot. Oops.
---
lib/fsm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/fsm.c b/lib/fsm.c
index 129054067..7987abbc9 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -374,8 +374,6 @@ static int fsmDoMkDir(rpmPlugins plugins, int dirfd, const char *dn,
static int ensureDir(rpmPlugins plugins, const char *p, int owned, int create,
int quiet, int *dirfdp)
{
- char *path = xstrdup(p);
- char *dp = path;
char *sp = NULL, *bn;
char *apath = NULL;
int oflags = O_RDONLY;
@@ -387,6 +385,9 @@ static int ensureDir(rpmPlugins plugins, const char *p, int owned, int create,
int dirfd = fsmOpenat(-1, "/", oflags, 1);
int fd = dirfd; /* special case of "/" */
+ char *path = xstrdup(p);
+ char *dp = path;
+
while ((bn = strtok_r(dp, "/", &sp)) != NULL) {
fd = fsmOpenat(dirfd, bn, oflags, 1);
/* assemble absolute path for plugins benefit, sigh */
--
2.37.3

View File

@ -1,28 +0,0 @@
From 19d73f67883c011cc74326a5dc34f7009efa60e1 Mon Sep 17 00:00:00 2001
Message-Id: <19d73f67883c011cc74326a5dc34f7009efa60e1.1662536462.git.pmatilai@redhat.com>
From: Panu Matilainen <pmatilai@redhat.com>
Date: Tue, 6 Sep 2022 13:15:44 +0300
Subject: [PATCH] Fix buffer overrun from commit
4420c78beb86cc67392274bf351478a3375626a2
The newly handled ^ needs to be accounted for when allocating memory.
Found when testing #1936, goes to show what a useful thing that is.
---
lib/rpmdb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
index fd2b0671a..b3c5da62d 100644
--- a/lib/rpmdb.c
+++ b/lib/rpmdb.c
@@ -1107,6 +1107,7 @@ static char * mireDup(rpmTagVal tag, rpmMireMode *modep,
case '.':
case '+':
case '*':
+ case '^':
if (!brackets) nb++;
break;
case '\\':
--
2.37.3

View File

@ -29,8 +29,8 @@
%define rpmhome /usr/lib/rpm
%global rpmver 4.18.0
%global snapver rc1
%global baserelease 4
#global snapver rc1
%global baserelease 1
%global sover 9
%global srcver %{rpmver}%{?snapver:-%{snapver}}
@ -56,8 +56,6 @@ Patch1: rpm-4.17.x-siteconfig.patch
Patch3: rpm-4.9.90-no-man-dirs.patch
# Patches already upstream:
Patch100: 0001-Fix-buffer-overrun-from-commit-4420c78beb86cc6739227.patch
Patch101: 0001-Fix-a-memory-leak-in-the-new-directory-dance-in-ensu.patch
# These are not yet upstream
Patch906: rpm-4.7.1-geode-i686.patch
@ -612,6 +610,9 @@ fi
%doc docs/librpm/html/*
%changelog
* Wed Sep 21 2022 Panu Matilainen <pmatilai@redhat.com> - 4.18.0-1
- Rebase to rpm 4.18.0 (https://rpm.org/wiki/Releases/4.18.0)
* Wed Sep 14 2022 Panu Matilainen <pmatilai@redhat.com> - 4.18.0-0.rc1.4
- Fix a largish directory walk related memory leak in transactions

View File

@ -1 +1 @@
SHA512 (rpm-4.18.0-rc1.tar.bz2) = 64b4a9db704ba1a3d7b1bcf653eca3aa674573f5906f55e1d191b85b5c10b82e1ec591bfe4fbd209445bf818cc2cfb07b2e5e8696e09a46e5ee803355ff5ad4d
SHA512 (rpm-4.18.0.tar.bz2) = c218b811c0c2db368a2919f60742904a4a5abf09dc20804d649eb42f1853d1c21d121086d6014cd210b2040643c37b5d86b53052958cf702ae2e54fe65f1c0ec