!221 backport some patches from upstream
From: @renxichen Reviewed-by: @licunlong Signed-off-by: @licunlong
This commit is contained in:
commit
9a339e820f
26
backport-Fix-BANames-leak-in-handlePreambleTag.patch
Normal file
26
backport-Fix-BANames-leak-in-handlePreambleTag.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
From 7fcdfd3b40f69af6a1d4980683859eef05f39b4e Mon Sep 17 00:00:00 2001
|
||||||
|
From: xujing <xujing125@huawei.com>
|
||||||
|
Date: Fri, 25 Nov 2022 16:48:34 +0800
|
||||||
|
Subject: [PATCH] Fix BANames leak in handlePreambleTag
|
||||||
|
|
||||||
|
The "BANames" is alloced from popParseArgvString but not freed
|
||||||
|
when spec->packages != pkg. Fix it.
|
||||||
|
---
|
||||||
|
build/parsePreamble.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/build/parsePreamble.c b/build/parsePreamble.c
|
||||||
|
index 119551cf6..c4d137cf7 100644
|
||||||
|
--- a/build/parsePreamble.c
|
||||||
|
+++ b/build/parsePreamble.c
|
||||||
|
@@ -961,6 +961,7 @@ static rpmRC handlePreambleTag(rpmSpec spec, Package pkg, rpmTagVal tag,
|
||||||
|
BANames = _free(BANames);
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
+ BANames = _free(BANames);
|
||||||
|
headerPutString(pkg->header, RPMTAG_ARCH, "noarch");
|
||||||
|
}
|
||||||
|
if (!BACount)
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
28
backport-Fix-elf-leak-in-getElfColor.patch
Normal file
28
backport-Fix-elf-leak-in-getElfColor.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
From 01196e00beefc2ba6f7f0787350c5dd76891829a Mon Sep 17 00:00:00 2001
|
||||||
|
From: xujing <xujing125@huawei.com>
|
||||||
|
Date: Fri, 25 Nov 2022 17:11:22 +0800
|
||||||
|
Subject: [PATCH] Fix elf leak in getElfColor
|
||||||
|
|
||||||
|
The "elf" is leaked in getElfColor when gelf_getehdr return fail.
|
||||||
|
---
|
||||||
|
build/rpmfc.c | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/build/rpmfc.c b/build/rpmfc.c
|
||||||
|
index d35c148b9..06205469c 100644
|
||||||
|
--- a/build/rpmfc.c
|
||||||
|
+++ b/build/rpmfc.c
|
||||||
|
@@ -1145,8 +1145,9 @@ static uint32_t getElfColor(const char *fn)
|
||||||
|
color = RPMFC_ELF32;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
- elf_end(elf);
|
||||||
|
}
|
||||||
|
+ if (elf)
|
||||||
|
+ elf_end(elf);
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
|
return color;
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
From 3b0b9d491f5828a40c15b76b4a19ca00006cf81e Mon Sep 17 00:00:00 2001
|
||||||
|
From: xujing <xujing125@huawei.com>
|
||||||
|
Date: Mon, 28 Nov 2022 11:02:47 +0800
|
||||||
|
Subject: [PATCH] Fix memleak when running %generate_buildrequires
|
||||||
|
|
||||||
|
The "output[i]" is alloced in argvSplit but not freed when running
|
||||||
|
%generate_buildrequires. Fix it.
|
||||||
|
---
|
||||||
|
build/build.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/build/build.c b/build/build.c
|
||||||
|
index 4437f6c9c..34e01d5be 100644
|
||||||
|
--- a/build/build.c
|
||||||
|
+++ b/build/build.c
|
||||||
|
@@ -279,7 +279,7 @@ static int doBuildRequires(rpmSpec spec, int test)
|
||||||
|
|
||||||
|
exit:
|
||||||
|
freeStringBuf(sb_stdout);
|
||||||
|
- free(output);
|
||||||
|
+ argvFree(output);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
35
backport-Fix-prog-leak-in-parseScript.patch
Normal file
35
backport-Fix-prog-leak-in-parseScript.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
From c013821c0c9350b67d9f9a02848e1a7f87fa180b Mon Sep 17 00:00:00 2001
|
||||||
|
From: xujing <xujing125@huawei.com>
|
||||||
|
Date: Fri, 25 Nov 2022 17:04:11 +0800
|
||||||
|
Subject: [PATCH] Fix prog leak in parseScript
|
||||||
|
|
||||||
|
The "prog" will be alloced when using "-p" options, which cause src
|
||||||
|
"proc" leak. Add "origproc" to point to src "proc" to fix it.
|
||||||
|
---
|
||||||
|
build/parseScript.c | 3 +++
|
||||||
|
1 file changed, 3 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/build/parseScript.c b/build/parseScript.c
|
||||||
|
index df7919238..f8b693ac6 100644
|
||||||
|
--- a/build/parseScript.c
|
||||||
|
+++ b/build/parseScript.c
|
||||||
|
@@ -102,6 +102,7 @@ int parseScript(rpmSpec spec, int parsePart)
|
||||||
|
poptContext optCon = NULL;
|
||||||
|
char *name = NULL;
|
||||||
|
char *prog = xstrdup("/bin/sh");
|
||||||
|
+ char *origprog = prog;
|
||||||
|
char *file = NULL;
|
||||||
|
int priority = 1000000;
|
||||||
|
struct poptOption optionsTable[] = {
|
||||||
|
@@ -482,6 +483,8 @@ exit:
|
||||||
|
free(reqargs);
|
||||||
|
freeStringBuf(sb);
|
||||||
|
free(progArgv);
|
||||||
|
+ if (origprog != prog)
|
||||||
|
+ free(origprog);
|
||||||
|
free(prog);
|
||||||
|
free(name);
|
||||||
|
free(file);
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
28
backport-Fix-sbp-leak-when-running-rpmbuild-with-quiet.patch
Normal file
28
backport-Fix-sbp-leak-when-running-rpmbuild-with-quiet.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
From 6130bd31038ff17a03fcac6ec7e41ac744163dde Mon Sep 17 00:00:00 2001
|
||||||
|
From: xujing <xujing125@huawei.com>
|
||||||
|
Date: Sat, 26 Nov 2022 11:39:48 +0800
|
||||||
|
Subject: [PATCH] Fix *sbp leak when running rpmbuild with --quiet
|
||||||
|
|
||||||
|
When running rpmbuild with --quiet, the "*sbp" may be alloced many
|
||||||
|
times in buildSpec by calling doScript but only freed once. Fix it.
|
||||||
|
---
|
||||||
|
build/build.c | 3 +++
|
||||||
|
1 file changed, 3 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/build/build.c b/build/build.c
|
||||||
|
index e50c378..28fa7c8 100644
|
||||||
|
--- a/build/build.c
|
||||||
|
+++ b/build/build.c
|
||||||
|
@@ -199,6 +199,9 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name,
|
||||||
|
buildCmd = rpmExpand(mCmd, " ", scriptName, NULL);
|
||||||
|
(void) poptParseArgvString(buildCmd, &argc, &argv);
|
||||||
|
|
||||||
|
+ if (sb_stdoutp && *sb_stdoutp)
|
||||||
|
+ *sb_stdoutp = freeStringBuf(*sb_stdoutp);
|
||||||
|
+
|
||||||
|
rpmlog(RPMLOG_NOTICE, _("Executing(%s): %s\n"), name, buildCmd);
|
||||||
|
if (rpmfcExec((ARGV_const_t)argv, NULL, sb_stdoutp, 1,
|
||||||
|
spec->buildSubdir)) {
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
11
rpm.spec
11
rpm.spec
@ -1,6 +1,6 @@
|
|||||||
Name: rpm
|
Name: rpm
|
||||||
Version: 4.15.1
|
Version: 4.15.1
|
||||||
Release: 47
|
Release: 48
|
||||||
Summary: RPM Package Manager
|
Summary: RPM Package Manager
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
URL: http://www.rpm.org/
|
URL: http://www.rpm.org/
|
||||||
@ -193,6 +193,12 @@ Patch173: backport-Fix-Header-leak-when-running-rpm2cpio.patch
|
|||||||
Patch174: backport-Use-unsigned-integers-more-consistently-in-the-handl.patch
|
Patch174: backport-Use-unsigned-integers-more-consistently-in-the-handl.patch
|
||||||
Patch175: backport-Revert-back-to-implicit-database-creation-for-now.patch
|
Patch175: backport-Revert-back-to-implicit-database-creation-for-now.patch
|
||||||
|
|
||||||
|
Patch176: backport-Fix-BANames-leak-in-handlePreambleTag.patch
|
||||||
|
Patch177: backport-Fix-prog-leak-in-parseScript.patch
|
||||||
|
Patch178: backport-Fix-elf-leak-in-getElfColor.patch
|
||||||
|
Patch179: backport-Fix-sbp-leak-when-running-rpmbuild-with-quiet.patch
|
||||||
|
Patch180: backport-Fix-memleak-when-running-generate_buildrequires.patch
|
||||||
|
|
||||||
BuildRequires: gcc autoconf automake libtool make gawk popt-devel openssl-devel readline-devel libdb-devel
|
BuildRequires: gcc autoconf automake libtool make gawk popt-devel openssl-devel readline-devel libdb-devel
|
||||||
BuildRequires: zlib-devel libzstd-devel xz-devel bzip2-devel libarchive-devel ima-evm-utils-devel
|
BuildRequires: zlib-devel libzstd-devel xz-devel bzip2-devel libarchive-devel ima-evm-utils-devel
|
||||||
BuildRequires: dbus-devel fakechroot elfutils-devel elfutils-libelf-devel ima-evm-utils
|
BuildRequires: dbus-devel fakechroot elfutils-devel elfutils-libelf-devel ima-evm-utils
|
||||||
@ -475,6 +481,9 @@ make check || (cat tests/rpmtests.log; exit 0)
|
|||||||
%{_mandir}/man1/gendiff.1*
|
%{_mandir}/man1/gendiff.1*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Mar 08 2023 renhongxun<renhongxun@h-partners.com> - 4.15.1-48
|
||||||
|
- backport some patches from upstream
|
||||||
|
|
||||||
* Wed Feb 22 2023 gaoyusong<gaoyusong2@huawei.com> - 4.15.1-47
|
* Wed Feb 22 2023 gaoyusong<gaoyusong2@huawei.com> - 4.15.1-47
|
||||||
- optimize digest list feature patch format
|
- optimize digest list feature patch format
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user