From 476a04e71ad23dcbcaa5b87cb3282819ed954de7 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sep 21 2022 10:24:24 +0000 Subject: Rebase to rpm 4.18.0 final --- diff --git a/.gitignore b/.gitignore index 34ae3e8..9580bae 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/0001-Fix-a-memory-leak-in-the-new-directory-dance-in-ensu.patch b/0001-Fix-a-memory-leak-in-the-new-directory-dance-in-ensu.patch deleted file mode 100644 index 5541a04..0000000 --- a/0001-Fix-a-memory-leak-in-the-new-directory-dance-in-ensu.patch +++ /dev/null @@ -1,38 +0,0 @@ -From f78be76a00878183da86d5e37ddbe421c5fe028c Mon Sep 17 00:00:00 2001 -Message-Id: -From: Panu Matilainen -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 - diff --git a/0001-Fix-buffer-overrun-from-commit-4420c78beb86cc6739227.patch b/0001-Fix-buffer-overrun-from-commit-4420c78beb86cc6739227.patch deleted file mode 100644 index 4010f59..0000000 --- a/0001-Fix-buffer-overrun-from-commit-4420c78beb86cc6739227.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 19d73f67883c011cc74326a5dc34f7009efa60e1 Mon Sep 17 00:00:00 2001 -Message-Id: <19d73f67883c011cc74326a5dc34f7009efa60e1.1662536462.git.pmatilai@redhat.com> -From: Panu Matilainen -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 - diff --git a/rpm.spec b/rpm.spec index cc80ba5..535c346 100644 --- a/rpm.spec +++ b/rpm.spec @@ -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 - 4.18.0-1 +- Rebase to rpm 4.18.0 (https://rpm.org/wiki/Releases/4.18.0) + * Wed Sep 14 2022 Panu Matilainen - 4.18.0-0.rc1.4 - Fix a largish directory walk related memory leak in transactions diff --git a/sources b/sources index 9d3cbfc..51b6aac 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rpm-4.18.0-rc1.tar.bz2) = 64b4a9db704ba1a3d7b1bcf653eca3aa674573f5906f55e1d191b85b5c10b82e1ec591bfe4fbd209445bf818cc2cfb07b2e5e8696e09a46e5ee803355ff5ad4d +SHA512 (rpm-4.18.0.tar.bz2) = c218b811c0c2db368a2919f60742904a4a5abf09dc20804d649eb42f1853d1c21d121086d6014cd210b2040643c37b5d86b53052958cf702ae2e54fe65f1c0ec