upgrade version to 4.18.1
This commit is contained in:
parent
b59a1546a8
commit
cd8a4991bd
@ -9,7 +9,7 @@ Subject: [PATCH] Add loongarch architecture support.
|
||||
2 files changed, 29 insertions(+)
|
||||
|
||||
diff --git a/installplatform b/installplatform
|
||||
index 7962f01..8c215b3 100755
|
||||
index ddcaa6d..fd37b0c 100755
|
||||
--- a/installplatform
|
||||
+++ b/installplatform
|
||||
@@ -180,6 +180,12 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do
|
||||
@ -23,7 +23,7 @@ index 7962f01..8c215b3 100755
|
||||
+ CANONCOLOR=0
|
||||
+ ;;
|
||||
loongarch64)
|
||||
ISANAME=loongarch64
|
||||
ISANAME=loongarch
|
||||
ISABITS=64
|
||||
diff --git a/rpmrc.in b/rpmrc.in
|
||||
index 6861b0a..74caf90 100644
|
||||
|
||||
@ -4,35 +4,37 @@ Date: Thu, 9 Jan 2020 19:16:58 +0800
|
||||
Subject: [PATCH] Unbundle config site and add RPM LD FLAGS macro
|
||||
|
||||
---
|
||||
macros.in | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
macros.in | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/macros.in b/macros.in
|
||||
index fe9803a..4027493 100644
|
||||
index a2411d7..8cb8a5a 100644
|
||||
--- a/macros.in
|
||||
+++ b/macros.in
|
||||
@@ -794,10 +794,11 @@ package or when debugging this package.\
|
||||
RPM_SOURCE_DIR=\"%{u2p:%{_sourcedir}}\"\
|
||||
RPM_BUILD_DIR=\"%{u2p:%{_builddir}}\"\
|
||||
@@ -727,10 +727,11 @@ package or when debugging this package.\
|
||||
RPM_SOURCE_DIR=\"%{_sourcedir}\"\
|
||||
RPM_BUILD_DIR=\"%{_builddir}\"\
|
||||
RPM_OPT_FLAGS=\"%{optflags}\"\
|
||||
+ RPM_LD_FLAGS=\"%{?build_ldflags}\"\
|
||||
RPM_ARCH=\"%{_arch}\"\
|
||||
RPM_OS=\"%{_os}\"\
|
||||
RPM_BUILD_NCPUS=\"%{_smp_build_ncpus}\"\
|
||||
- export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUS\
|
||||
+ export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUS RPM_OPT_FLAGS\
|
||||
+ export RPM_SOURCE_DIR RPM_BUILD_DIR RPM_OPT_FLAGS RPM_ARCH RPM_OS RPM_BUILD_NCPUSi RPM_OPT_FLAGS\
|
||||
RPM_DOC_DIR=\"%{_docdir}\"\
|
||||
export RPM_DOC_DIR\
|
||||
RPM_PACKAGE_NAME=\"%{NAME}\"\
|
||||
@@ -813,6 +814,8 @@ package or when debugging this package.\
|
||||
@@ -746,7 +747,9 @@ package or when debugging this package.\
|
||||
%{?_javaclasspath:CLASSPATH=\"%{_javaclasspath}\"\
|
||||
export CLASSPATH}\
|
||||
PKG_CONFIG_PATH=\"${PKG_CONFIG_PATH}:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig\"\
|
||||
export PKG_CONFIG_PATH\
|
||||
- export PKG_CONFIG_PATH
|
||||
+ export PKG_CONFIG_PATH\
|
||||
+ CONFIG_SITE=${CONFIG_SITE:-NONE}\
|
||||
+ export CONFIG_SITE\
|
||||
\
|
||||
%[%{verbose}?"set -x":""]\
|
||||
umask 022\
|
||||
--
|
||||
1.8.3.1
|
||||
+ export CONFIG_SITE
|
||||
|
||||
%___build_pre \
|
||||
%{___build_pre_env} \
|
||||
--
|
||||
2.27.0
|
||||
|
||||
|
||||
@ -1,79 +0,0 @@
|
||||
From 5dcc399cd21f607f13eb092a3abfc8b8daa59d4c Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Fri, 13 Jan 2023 10:44:28 +0200
|
||||
Subject: [PATCH] Add a test for special device node installation
|
||||
|
||||
This is a bit theoretical as it does not work for regular users or in
|
||||
containers which are the typical scenarios for running the test-suite.
|
||||
---
|
||||
tests/atlocal.in | 6 ++++++
|
||||
tests/data/SPECS/dev.spec | 14 ++++++++++++++
|
||||
tests/rpmi.at | 17 +++++++++++++++++
|
||||
3 files changed, 37 insertions(+)
|
||||
create mode 100644 tests/data/SPECS/dev.spec
|
||||
|
||||
diff --git a/tests/atlocal.in b/tests/atlocal.in
|
||||
index 70383bb46..a037de728 100644
|
||||
--- a/tests/atlocal.in
|
||||
+++ b/tests/atlocal.in
|
||||
@@ -64,6 +64,12 @@ if grep -q '#define WITH_CAP 1' "${abs_top_builddir}/config.h"; then
|
||||
else
|
||||
CAP_DISABLED=true;
|
||||
fi
|
||||
+if mknod foodev c 123 123; then
|
||||
+ MKNOD_DISABLED=false
|
||||
+ rm -f foodev
|
||||
+else
|
||||
+ MKNOD_DISABLED=true
|
||||
+fi
|
||||
|
||||
function setup_env()
|
||||
{
|
||||
diff --git a/tests/data/SPECS/dev.spec b/tests/data/SPECS/dev.spec
|
||||
new file mode 100644
|
||||
index 000000000..d784fe114
|
||||
--- /dev/null
|
||||
+++ b/tests/data/SPECS/dev.spec
|
||||
@@ -0,0 +1,14 @@
|
||||
+Name: dev
|
||||
+Version: 1.0
|
||||
+Release: 1
|
||||
+Group: Testing
|
||||
+License: GPL
|
||||
+Summary: Testing dev behavior
|
||||
+BuildArch: noarch
|
||||
+
|
||||
+%description
|
||||
+%{summary}
|
||||
+
|
||||
+%files
|
||||
+%dev(c 11 22) /test-char
|
||||
+%dev(b 33 44) /test-block
|
||||
diff --git a/tests/rpmi.at b/tests/rpmi.at
|
||||
index a2389de..f439e46 100644
|
||||
--- a/tests/rpmi.at
|
||||
+++ b/tests/rpmi.at
|
||||
@@ -888,3 +888,20 @@ runroot rpm -Vv --nouser --nogroup fifo
|
||||
],
|
||||
[])
|
||||
AT_CLEANUP
|
||||
+
|
||||
+AT_SETUP([rpm -U dev])
|
||||
+AT_KEYWORDS([install])
|
||||
+AT_SKIP_IF([$MKNOD_DISABLED])
|
||||
+AT_CHECK([
|
||||
+RPMDB_INIT
|
||||
+
|
||||
+runroot rpmbuild -bb --quiet /data/SPECS/dev.spec
|
||||
+runroot rpm -U --ignoreos /build/RPMS/noarch/dev-1.0-1.noarch.rpm
|
||||
+runroot rpm -Vv --nouser --nogroup dev
|
||||
+],
|
||||
+[0],
|
||||
+[......... /test-block
|
||||
+......... /test-char
|
||||
+],
|
||||
+[])
|
||||
+AT_CLEANUP
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
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 1/5] 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
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
From cf27c6f4963dcf27302d0f4fa39d7787dd03f942 Mon Sep 17 00:00:00 2001
|
||||
From: xujing <xujing125@huawei.com>
|
||||
Date: Fri, 25 Nov 2022 17:18:33 +0800
|
||||
Subject: [PATCH] Fix Header leak when running rpm2cpio
|
||||
|
||||
Header "h" is alloced in rpmReadPackageFile but not freed when
|
||||
running rpm2cpio. Fix it. Remove redundant whitespace between
|
||||
the Fclose()'s too while at it for logical cleanup grouping.
|
||||
---
|
||||
rpm2cpio.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/rpm2cpio.c b/rpm2cpio.c
|
||||
index fcc3b3079..940d6ce38 100644
|
||||
--- a/rpm2cpio.c
|
||||
+++ b/rpm2cpio.c
|
||||
@@ -96,8 +96,8 @@ int main(int argc, char *argv[])
|
||||
*/
|
||||
rc = (ufdCopy(gzdi, fdo) >= payload_size) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
||||
+ headerFree(h);
|
||||
Fclose(fdo);
|
||||
-
|
||||
Fclose(gzdi); /* XXX gzdi == fdi */
|
||||
|
||||
return rc;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
From 03525592c944957f3b7b200b7daeb9f615cdcde7 Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
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.27.0
|
||||
|
||||
@ -1,58 +0,0 @@
|
||||
From 856ddc334174fd37fe4ce81bc9f9f11a08cf6c81 Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Fri, 17 Mar 2023 12:53:42 +0200
|
||||
Subject: [PATCH] Fix a segfault on a non-stringable argument to macro call
|
||||
from Lua
|
||||
|
||||
When natively calling a parametric macro from Lua, with the arguments
|
||||
inside a table, we can't assume lua_tostring() always succeeds as it
|
||||
can fail eg on a table. Report the error instead of crashing in argvAdd(),
|
||||
and add a test as well.
|
||||
---
|
||||
rpmio/rpmlua.c | 9 +++++++--
|
||||
tests/rpmmacro.at | 9 +++++++++
|
||||
2 files changed, 16 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/rpmio/rpmlua.c b/rpmio/rpmlua.c
|
||||
index 6c42af792..0e3685713 100644
|
||||
--- a/rpmio/rpmlua.c
|
||||
+++ b/rpmio/rpmlua.c
|
||||
@@ -1178,8 +1178,13 @@ static int mc_call(lua_State *L)
|
||||
|
||||
for (int i = 1; i <= nitem; i++) {
|
||||
lua_rawgeti(L, 1, i);
|
||||
- argvAdd(&argv, lua_tostring(L, -1));
|
||||
- lua_pop(L, 1);
|
||||
+ const char *s= lua_tostring(L, -1);
|
||||
+ if (s) {
|
||||
+ argvAdd(&argv, s);
|
||||
+ lua_pop(L, 1);
|
||||
+ } else {
|
||||
+ luaL_argerror(L, i, "cannot convert to string");
|
||||
+ }
|
||||
}
|
||||
|
||||
if (rpmExpandThisMacro(*mc, name, argv, &buf, 0) >= 0) {
|
||||
diff --git a/tests/rpmmacro.at b/tests/rpmmacro.at
|
||||
index 55b7d5fa5..22d873e81 100644
|
||||
--- a/tests/rpmmacro.at
|
||||
+++ b/tests/rpmmacro.at
|
||||
@@ -713,6 +713,15 @@ nil
|
||||
1:%{?aaa} 2:%{yyy}
|
||||
that
|
||||
])
|
||||
+
|
||||
+AT_CHECK([[
|
||||
+runroot rpm \
|
||||
+ --eval "%{lua:macros.defined({1,2,{}})}"
|
||||
+]],
|
||||
+[1],
|
||||
+[],
|
||||
+[[error: lua script failed: [string "<lua>"]:1: bad argument #3 to 'defined' (cannot convert to string)
|
||||
+]])
|
||||
AT_CLEANUP
|
||||
|
||||
AT_SETUP([lua macros recursion])
|
||||
--
|
||||
2.27.0
|
||||
|
||||
40
backport-Fix-compiler-error-on-clang.patch
Normal file
40
backport-Fix-compiler-error-on-clang.patch
Normal file
@ -0,0 +1,40 @@
|
||||
From b960c0b43a080287a7c13533eeb2d9f288db1414 Mon Sep 17 00:00:00 2001
|
||||
From: Florian Festi <ffesti@redhat.com>
|
||||
Date: Thu, 16 Mar 2023 19:05:04 +0100
|
||||
Subject: [PATCH] Fix compiler error on clang
|
||||
|
||||
Turns out variable declarations are not allowed after a label, even in
|
||||
C99. And while some compilers don't seem to care others do.
|
||||
|
||||
Moving the declaration of mayopen to the start of the function to avoid
|
||||
this problem.
|
||||
|
||||
Resolves: #2435
|
||||
---
|
||||
lib/fsm.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/fsm.c b/lib/fsm.c
|
||||
index 5671ac642..183293edb 100644
|
||||
--- a/lib/fsm.c
|
||||
+++ b/lib/fsm.c
|
||||
@@ -879,6 +879,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
|
||||
int nodigest = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOFILEDIGEST) ? 1 : 0;
|
||||
int nofcaps = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCAPS) ? 1 : 0;
|
||||
int firstlinkfile = -1;
|
||||
+ int mayopen = 0;
|
||||
char *tid = NULL;
|
||||
struct filedata_s *fdata = xcalloc(fc, sizeof(*fdata));
|
||||
struct filedata_s *firstlink = NULL;
|
||||
@@ -1016,7 +1017,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
|
||||
|
||||
setmeta:
|
||||
/* Special files require path-based ops */
|
||||
- int mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
|
||||
+ mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
|
||||
if (!rc && fd == -1 && mayopen) {
|
||||
int flags = O_RDONLY;
|
||||
/* Only follow safe symlinks, and never on temporary files */
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
From 084c64d5ea0e1a309d3b57dc95926eb1536d0a7a Mon Sep 17 00:00:00 2001
|
||||
From: xujing <xujing125@huawei.com>
|
||||
Date: Thu, 24 Nov 2022 11:43:28 +0800
|
||||
Subject: [PATCH 1/3] Fix eiu->sourceURL info leak in rpmInstall()
|
||||
|
||||
When installing source rpms, eiu->sourceURL info is leaked.
|
||||
---
|
||||
lib/rpminstall.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
|
||||
index 097599681..eb68deb4d 100644
|
||||
--- a/lib/rpminstall.c
|
||||
+++ b/lib/rpminstall.c
|
||||
@@ -672,8 +672,13 @@ exit:
|
||||
eiu->pkgURL[i] = _free(eiu->pkgURL[i]);
|
||||
}
|
||||
}
|
||||
+ if (eiu->sourceURL != NULL) {
|
||||
+ for (i = 0; i < eiu->numSRPMS; i++)
|
||||
+ eiu->sourceURL[i] = _free(eiu->sourceURL[i]);
|
||||
+ }
|
||||
eiu->pkgState = _free(eiu->pkgState);
|
||||
eiu->pkgURL = _free(eiu->pkgURL);
|
||||
+ eiu->sourceURL = _free(eiu->sourceURL);
|
||||
eiu->argv = _free(eiu->argv);
|
||||
rc = eiu->numFailed;
|
||||
free(eiu);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
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 3/5] 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);
|
||||
}
|
||||
#endif
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
From 0b34438ccc3fdcbdaa6226d2398df88cc7439603 Mon Sep 17 00:00:00 2001
|
||||
From: xujing <xujing125@huawei.com>
|
||||
Date: Thu, 24 Nov 2022 17:16:46 +0800
|
||||
Subject: [PATCH 2/3] Fix file leak when src rpm in URL format is used for
|
||||
installation
|
||||
|
||||
%{_tmppath}/rpm-tmp.* is created by rpmMkTempFile() when src rpm in
|
||||
URL format is used for installation, which is leaked.
|
||||
---
|
||||
lib/rpminstall.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
|
||||
index eb68deb4d..b392cf1c3 100644
|
||||
--- a/lib/rpminstall.c
|
||||
+++ b/lib/rpminstall.c
|
||||
@@ -673,8 +673,12 @@ exit:
|
||||
}
|
||||
}
|
||||
if (eiu->sourceURL != NULL) {
|
||||
- for (i = 0; i < eiu->numSRPMS; i++)
|
||||
+ for (i = 0; i < eiu->numSRPMS; i++) {
|
||||
+ if (eiu->sourceURL[i] == NULL) continue;
|
||||
+ if (eiu->pkgState[i] == 1)
|
||||
+ (void) unlink(eiu->sourceURL[i]);
|
||||
eiu->sourceURL[i] = _free(eiu->sourceURL[i]);
|
||||
+ }
|
||||
}
|
||||
eiu->pkgState = _free(eiu->pkgState);
|
||||
eiu->pkgURL = _free(eiu->pkgURL);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
From f0f983b145583eeed618cf3cbc5d39bedd8af5a5 Mon Sep 17 00:00:00 2001
|
||||
From: xujing <xujing125@huawei.com>
|
||||
Date: Mon, 28 Nov 2022 11:19:20 +0800
|
||||
Subject: [PATCH 2/3] Fix fileleak and memleak in rpmInstall
|
||||
|
||||
The "*eiu->fnp" from "eiu->pkgURL[eiu->pkgx]" which is alloced. when
|
||||
Fopen or rpmReadPackageFile fails in tryReadHeader, "*eiu->fnp" is
|
||||
set to NULL but not freed. In addition, if "eiu->pkgState[eiu->pkgx]"
|
||||
is set, the file is leaked too. Fix it.
|
||||
|
||||
Only resource free is added, no other logic change.
|
||||
---
|
||||
lib/rpminstall.c | 12 +++++++++---
|
||||
1 file changed, 9 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
|
||||
index b392cf1c3..90474fabf 100644
|
||||
--- a/lib/rpminstall.c
|
||||
+++ b/lib/rpminstall.c
|
||||
@@ -355,7 +355,6 @@ static int tryReadHeader(rpmts ts, struct rpmEIU * eiu, Header * hdrp)
|
||||
fd = NULL;
|
||||
}
|
||||
eiu->numFailed++;
|
||||
- *eiu->fnp = NULL;
|
||||
return RPMRC_FAIL;
|
||||
}
|
||||
|
||||
@@ -371,7 +370,6 @@ static int tryReadHeader(rpmts ts, struct rpmEIU * eiu, Header * hdrp)
|
||||
if (eiu->rpmrc == RPMRC_FAIL) {
|
||||
rpmlog(RPMLOG_ERR, _("%s cannot be installed\n"), *eiu->fnp);
|
||||
eiu->numFailed++;
|
||||
- *eiu->fnp = NULL;
|
||||
}
|
||||
|
||||
return RPMRC_OK;
|
||||
@@ -554,8 +552,12 @@ restart:
|
||||
rpmlog(RPMLOG_DEBUG, "============== %s\n", *eiu->fnp);
|
||||
(void) urlPath(*eiu->fnp, &fileName);
|
||||
|
||||
- if (tryReadHeader(ts, eiu, &h) == RPMRC_FAIL)
|
||||
+ if (tryReadHeader(ts, eiu, &h) == RPMRC_FAIL) {
|
||||
+ if (eiu->pkgState[eiu->fnp - eiu->pkgURL] == 1)
|
||||
+ (void) unlink(*eiu->fnp);
|
||||
+ *eiu->fnp = _free(*eiu->fnp);
|
||||
continue;
|
||||
+ }
|
||||
|
||||
if (eiu->rpmrc == RPMRC_NOTFOUND) {
|
||||
rc = tryReadManifest(eiu);
|
||||
@@ -564,6 +566,10 @@ restart:
|
||||
headerFree(h);
|
||||
goto restart;
|
||||
}
|
||||
+ } else if (eiu->rpmrc == RPMRC_FAIL) {
|
||||
+ if (eiu->pkgState[eiu->fnp - eiu->pkgURL] == 1)
|
||||
+ (void) unlink(*eiu->fnp);
|
||||
+ *eiu->fnp = _free(*eiu->fnp);
|
||||
}
|
||||
|
||||
if (headerIsSource(h)) {
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
From af81c95114bc2c01f005f15f17646a5188b5855d Mon Sep 17 00:00:00 2001
|
||||
From: xujing <xujing125@huawei.com>
|
||||
Date: Mon, 28 Nov 2022 11:34:24 +0800
|
||||
Subject: [PATCH 3/3] Fix fileleak when urlGetFile fails in rpmInstall
|
||||
|
||||
The "tfn" is created by calling rpmMkTempFile but not unlinked when
|
||||
urlGetFile fails in rpmInstall. Fix it.
|
||||
---
|
||||
lib/rpminstall.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
|
||||
index 90474fabf..c89ca30b5 100644
|
||||
--- a/lib/rpminstall.c
|
||||
+++ b/lib/rpminstall.c
|
||||
@@ -520,7 +520,10 @@ restart:
|
||||
_("skipping %s - transfer failed\n"), fileURL);
|
||||
eiu->numFailed++;
|
||||
eiu->pkgURL[eiu->pkgx] = NULL;
|
||||
- tfn = _free(tfn);
|
||||
+ if (tfn) {
|
||||
+ (void) unlink(tfn);
|
||||
+ tfn = _free(tfn);
|
||||
+ }
|
||||
break;
|
||||
}
|
||||
eiu->pkgState[eiu->pkgx] = 1;
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
From 86c1d9738de58eb8f8844c5345baeb578ace9485 Mon Sep 17 00:00:00 2001
|
||||
From: xujing <xujing125@huawei.com>
|
||||
Date: Thu, 24 Nov 2022 17:33:53 +0800
|
||||
Subject: [PATCH 3/3] Fix h->blob leak when installing source rpms
|
||||
|
||||
When installing source rpms, "ei" is malloced and is saved in
|
||||
blob->ei by rpmReadPackageFile->rpmpkgRead->hdrblobRead, and then
|
||||
blob->ei is saved in h->blob by rpmReadPackageFile->hdrblobImport,
|
||||
which is leaked during installation.
|
||||
---
|
||||
lib/header.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/lib/header.c b/lib/header.c
|
||||
index 31d2fca30..004102dd2 100644
|
||||
--- a/lib/header.c
|
||||
+++ b/lib/header.c
|
||||
@@ -241,6 +241,7 @@ Header headerFree(Header h)
|
||||
}
|
||||
h->index = _free(h->index);
|
||||
}
|
||||
+ h->blob = _free(h->blob);
|
||||
|
||||
h = _free(h);
|
||||
return NULL;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,42 +0,0 @@
|
||||
From 15a0c73f4698bc58fa2a633d46527c7813150f3a Mon Sep 17 00:00:00 2001
|
||||
From: xujing <xujing125@huawei.com>
|
||||
Date: Thu, 24 Nov 2022 10:43:11 +0800
|
||||
Subject: [PATCH] Fix header leak in rpmInstall()
|
||||
|
||||
When rpm installs a package, the header from tryReadHeader()
|
||||
in rpmInstall() is leaked in some cases.
|
||||
---
|
||||
lib/rpminstall.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
|
||||
index 9167dbdde..097599681 100644
|
||||
--- a/lib/rpminstall.c
|
||||
+++ b/lib/rpminstall.c
|
||||
@@ -561,13 +561,14 @@ restart:
|
||||
rc = tryReadManifest(eiu);
|
||||
if (rc == RPMRC_OK) {
|
||||
eiu->prevx++;
|
||||
+ headerFree(h);
|
||||
goto restart;
|
||||
}
|
||||
}
|
||||
|
||||
if (headerIsSource(h)) {
|
||||
+ headerFree(h);
|
||||
if (ia->installInterfaceFlags & INSTALL_FRESHEN) {
|
||||
- headerFree(h);
|
||||
continue;
|
||||
}
|
||||
rpmlog(RPMLOG_DEBUG, "\tadded source package [%d]\n",
|
||||
@@ -592,6 +593,7 @@ restart:
|
||||
rpmlog(RPMLOG_ERR, _("package %s is not relocatable\n"),
|
||||
headerGetString(h, RPMTAG_NAME));
|
||||
eiu->numFailed++;
|
||||
+ headerFree(h);
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,110 +0,0 @@
|
||||
From 28c92fd54c93371c3062664d8a938438a2be88d6 Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Fri, 13 Jan 2023 08:57:27 +0200
|
||||
Subject: [PATCH] Fix install of block and character special files (#2195,
|
||||
#2275)
|
||||
|
||||
While it's possible to open special files, they are, well, special and
|
||||
have "side-effects" also known as, ahem, semantics. Opening a device
|
||||
file in Unix means accessing that *device*, and FIFOs have their own
|
||||
semantics. In other words, for rpm's purposes, we should never EVER
|
||||
open these files as a part of the install / permission setting etc.
|
||||
Fix this major brainfart in 25a435e90844ea98fe5eb7bef22c1aecf3a9c033.
|
||||
|
||||
OTOH this forces us back to the less secure path based operations for
|
||||
these files, which is what we were trying to avoid in the first place.
|
||||
There always was a tiny race between create + open for these (because
|
||||
there's no atomic way to create + open anything but regular files) but
|
||||
this opens up the window quite a bit.
|
||||
Nobody should be placing device nodes in user-owned directories but
|
||||
FIFO's may be a different story.
|
||||
|
||||
We haven't had tests for device nodes because it requires privileges the
|
||||
test-suite usually doesn't have, not testing FIFOs I have no excuse for.
|
||||
Add that test now.
|
||||
|
||||
Fixes: #2195, #2275
|
||||
---
|
||||
lib/fsm.c | 4 +++-
|
||||
tests/data/SPECS/fifo.spec | 16 ++++++++++++++++
|
||||
tests/Makefile.am | 2 +-
|
||||
tests/rpmi.at | 15 +++++++++++++++
|
||||
4 files changed, 35 insertions(+), 2 deletions(-)
|
||||
create mode 100644 tests/data/SPECS/fifo.spec
|
||||
|
||||
diff --git a/lib/fsm.c b/lib/fsm.c
|
||||
index e38155df7..052416641 100644
|
||||
--- a/lib/fsm.c
|
||||
+++ b/lib/fsm.c
|
||||
@@ -1014,7 +1014,9 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
|
||||
rc = RPMERR_UNKNOWN_FILETYPE;
|
||||
}
|
||||
|
||||
- if (!rc && fd == -1 && !S_ISLNK(fp->sb.st_mode)) {
|
||||
+ /* Special files require path-based ops */
|
||||
+ int mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
|
||||
+ if (!rc && fd == -1 && mayopen) {
|
||||
/* Only follow safe symlinks, and never on temporary files */
|
||||
fd = fsmOpenat(di.dirfd, fp->fpath,
|
||||
fp->suffix ? AT_SYMLINK_NOFOLLOW : 0, 0);
|
||||
diff --git a/tests/data/SPECS/fifo.spec b/tests/data/SPECS/fifo.spec
|
||||
new file mode 100644
|
||||
index 000000000..20b30b243
|
||||
--- /dev/null
|
||||
+++ b/tests/data/SPECS/fifo.spec
|
||||
@@ -0,0 +1,16 @@
|
||||
+Name: fifo
|
||||
+Version: 1.0
|
||||
+Release: 1
|
||||
+Group: Testing
|
||||
+License: GPL
|
||||
+Summary: Testing fifo behavior
|
||||
+BuildArch: noarch
|
||||
+
|
||||
+%description
|
||||
+%{summary}
|
||||
+
|
||||
+%install
|
||||
+mknod ${RPM_BUILD_ROOT}/test-fifo p
|
||||
+
|
||||
+%files
|
||||
+/test-fifo
|
||||
diff --git a/tests/Makefile.am b/tests/Makefile.am
|
||||
index 04fa1e5..1b12148 100644
|
||||
--- a/tests/Makefile.am
|
||||
+++ b/tests/Makefile.am
|
||||
@@ -174,7 +174,7 @@ populate_testing:
|
||||
for d in dev etc magic tmp var; do if [ ! -d testing/$${d} ]; then mkdir testing/$${d}; fi; done
|
||||
for node in urandom stdin stderr stdout null full; do ln -s /dev/$${node} testing/dev/$${node}; done
|
||||
for cf in hosts resolv.conf passwd shadow group gshadow mtab ; do [ -f /etc/$${cf} ] && ln -s /etc/$${cf} testing/etc/$${cf}; done
|
||||
- for prog in gzip cat patch tar sh ln chmod rm mkdir uname grep sed find file ionice mktemp nice cut sort diff touch install wc coreutils xargs; do p=`which $${prog}`; if [ "$${p}" != "" ]; then ln -s $${p} testing/$(bindir)/; fi; done
|
||||
+ for prog in gzip cat patch tar sh ln chmod rm mkdir uname grep sed find file ionice mktemp nice cut sort diff touch install wc coreutils xargs mknod; do p=`which $${prog}`; if [ "$${p}" != "" ]; then ln -s $${p} testing/$(bindir)/; fi; done
|
||||
for d in /proc /sys /selinux /etc/selinux; do if [ -d $${d} ]; then ln -s $${d} testing/$${d}; fi; done
|
||||
(cd testing/magic && file -C)
|
||||
chmod -R u-w testing/
|
||||
diff --git a/tests/rpmi.at b/tests/rpmi.at
|
||||
index ee35bdc..a2389de 100644
|
||||
--- a/tests/rpmi.at
|
||||
+++ b/tests/rpmi.at
|
||||
@@ -873,3 +873,18 @@ runroot rpm -e hlinktest
|
||||
],
|
||||
[])
|
||||
AT_CLEANUP
|
||||
+
|
||||
+AT_SETUP([rpm -U fifo])
|
||||
+AT_KEYWORDS([install])
|
||||
+AT_CHECK([
|
||||
+RPMDB_INIT
|
||||
+
|
||||
+runroot rpmbuild -bb --quiet /data/SPECS/fifo.spec
|
||||
+runroot rpm -U --ignoreos /build/RPMS/noarch/fifo-1.0-1.noarch.rpm
|
||||
+runroot rpm -Vv --nouser --nogroup fifo
|
||||
+],
|
||||
+[0],
|
||||
+[......... /test-fifo
|
||||
+],
|
||||
+[])
|
||||
+AT_CLEANUP
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
From 688c4ad34d197055eb8f58fb4e45065af881598c Mon Sep 17 00:00:00 2001
|
||||
From: xujing <xujing125@huawei.com>
|
||||
Date: Mon, 28 Nov 2022 11:10:19 +0800
|
||||
Subject: [PATCH 1/3] Fix memleak when fsmRename failed in fsmCommit
|
||||
|
||||
The "dest" is alloced in fsmFsPath but not freed when fsmRename failed
|
||||
in fsmCommit. Fix it.
|
||||
---
|
||||
lib/fsm.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/fsm.c b/lib/fsm.c
|
||||
index 7987abbc9..e38155df7 100644
|
||||
--- a/lib/fsm.c
|
||||
+++ b/lib/fsm.c
|
||||
@@ -782,7 +782,8 @@ static int fsmCommit(int dirfd, char **path, rpmfi fi, rpmFileAction action, con
|
||||
}
|
||||
free(*path);
|
||||
*path = dest;
|
||||
- }
|
||||
+ } else
|
||||
+ free(dest);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
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 5/5] 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
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
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 2/5] 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
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
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 4/5] 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 9cd569b83..4437f6c9c 100644
|
||||
--- a/build/build.c
|
||||
+++ b/build/build.c
|
||||
@@ -216,6 +216,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, buildSubdir)) {
|
||||
rpmlog(RPMLOG_ERR, _("Bad exit status from %s (%s)\n"),
|
||||
--
|
||||
2.27.0
|
||||
|
||||
36
backport-Move-variable-to-nearest-available-scope.patch
Normal file
36
backport-Move-variable-to-nearest-available-scope.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From 8be31c77806604cdca3cf628fb087bc1cc3d5c9e Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Fri, 17 Mar 2023 14:36:26 +0200
|
||||
Subject: [PATCH] Move variable to nearest available scope
|
||||
|
||||
Commit b960c0b43a080287a7c13533eeb2d9f288db1414 moved mayopen all the
|
||||
way to the function scope when the local if scope would've been enough.
|
||||
In a function with complex loops and all, nothing good comes out of having
|
||||
variables at unnecessarily wide scope.
|
||||
---
|
||||
lib/fsm.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/lib/fsm.c b/lib/fsm.c
|
||||
index 183293edb..747ed2b09 100644
|
||||
--- a/lib/fsm.c
|
||||
+++ b/lib/fsm.c
|
||||
@@ -879,7 +879,6 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
|
||||
int nodigest = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOFILEDIGEST) ? 1 : 0;
|
||||
int nofcaps = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCAPS) ? 1 : 0;
|
||||
int firstlinkfile = -1;
|
||||
- int mayopen = 0;
|
||||
char *tid = NULL;
|
||||
struct filedata_s *fdata = xcalloc(fc, sizeof(*fdata));
|
||||
struct filedata_s *firstlink = NULL;
|
||||
@@ -940,6 +939,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
|
||||
fp = firstlink;
|
||||
|
||||
if (!fp->skip) {
|
||||
+ int mayopen = 0;
|
||||
int fd = -1;
|
||||
rc = ensureDir(plugins, rpmfiDN(fi), 0,
|
||||
(fp->action == FA_CREATE), 0, &di.dirfd);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,46 +0,0 @@
|
||||
From 932013698149d43720cc321c8df2f99f51866e18 Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Fri, 13 Jan 2023 10:00:37 +0200
|
||||
Subject: [PATCH] Use fd-based ops for metadata in FA_TOUCH mode too,
|
||||
when
|
||||
possible
|
||||
|
||||
Fixes another brainfart in commit 25a435e90844ea98fe5eb7bef22c1aecf3a9c033.
|
||||
---
|
||||
lib/fsm.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lib/fsm.c b/lib/fsm.c
|
||||
index 54fea90..e6fac40 100644
|
||||
--- a/lib/fsm.c
|
||||
+++ b/lib/fsm.c
|
||||
@@ -1002,6 +1002,7 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
|
||||
int nodigest = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOFILEDIGEST) ? 1 : 0;
|
||||
int nofcaps = (rpmtsFlags(ts) & RPMTRANS_FLAG_NOCAPS) ? 1 : 0;
|
||||
int firstlinkfile = -1;
|
||||
+ int mayopen = 0;
|
||||
char *tid = NULL;
|
||||
struct filedata_s *fdata = xcalloc(fc, sizeof(*fdata));
|
||||
struct filedata_s *firstlink = NULL;
|
||||
@@ -1136,8 +1137,9 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
|
||||
rc = RPMERR_UNKNOWN_FILETYPE;
|
||||
}
|
||||
|
||||
+setmeta:
|
||||
/* Special files require path-based ops */
|
||||
- int mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
|
||||
+ mayopen = S_ISREG(fp->sb.st_mode) || S_ISDIR(fp->sb.st_mode);
|
||||
if (!rc && fd == -1 && mayopen) {
|
||||
/* Only follow safe symlinks, and never on temporary files */
|
||||
fd = fsmOpenat(di.dirfd, fp->fpath,
|
||||
@@ -1146,7 +1148,6 @@ int rpmPackageFilesInstall(rpmts ts, rpmte te, rpmfiles files,
|
||||
rc = RPMERR_OPEN_FAILED;
|
||||
}
|
||||
|
||||
-setmeta:
|
||||
if (!rc && fp->setmeta) {
|
||||
rc = fsmSetmeta(fd, di.dirfd, fp->fpath,
|
||||
fi, plugins, fp->action,
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
From 42694806bf73b07514554233d0d58d17a58cd863 Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Thu, 9 Feb 2023 13:05:24 +0200
|
||||
Subject: [PATCH] Use proper type for copyTagsFromMainDebug
|
||||
|
||||
The array contains a non-enum value (0), this is why headerCopyTags()
|
||||
uses rpmTagVal pointer, not rpmTag.
|
||||
---
|
||||
build/files.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/build/files.c b/build/files.c
|
||||
index 666c66651..24b4d80bf 100644
|
||||
--- a/build/files.c
|
||||
+++ b/build/files.c
|
||||
@@ -2858,7 +2858,7 @@ exit:
|
||||
return rc;
|
||||
}
|
||||
|
||||
-static rpmTag copyTagsFromMainDebug[] = {
|
||||
+static rpmTagVal copyTagsFromMainDebug[] = {
|
||||
RPMTAG_ARCH,
|
||||
RPMTAG_SUMMARY,
|
||||
RPMTAG_DESCRIPTION,
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
From 8e6108a5964c7289f3db70f3d188293276416528 Mon Sep 17 00:00:00 2001
|
||||
From: Daniel Alley <dalley@redhat.com>
|
||||
Date: Thu, 8 Dec 2022 09:40:00 -0500
|
||||
Subject: [PATCH] Use unsigned integers more consistently in the handling of
|
||||
tag data
|
||||
|
||||
Not a functional change, it just makes the code more clear and
|
||||
self-consistent.
|
||||
---
|
||||
lib/header.c | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/lib/header.c b/lib/header.c
|
||||
index 004102dd2..72fb3d4fe 100644
|
||||
--- a/lib/header.c
|
||||
+++ b/lib/header.c
|
||||
@@ -568,7 +568,7 @@ static int regionSwab(indexEntry entry, int il, int dl,
|
||||
}
|
||||
} break;
|
||||
case RPM_INT32_TYPE:
|
||||
- { int32_t * it = ie.data;
|
||||
+ { uint32_t * it = ie.data;
|
||||
for (; ie.info.count > 0; ie.info.count--, it += 1) {
|
||||
if (dataEnd && ((unsigned char *)it) >= dataEnd)
|
||||
return -1;
|
||||
@@ -576,7 +576,7 @@ static int regionSwab(indexEntry entry, int il, int dl,
|
||||
}
|
||||
} break;
|
||||
case RPM_INT16_TYPE:
|
||||
- { int16_t * it = ie.data;
|
||||
+ { uint16_t * it = ie.data;
|
||||
for (; ie.info.count > 0; ie.info.count--, it += 1) {
|
||||
if (dataEnd && ((unsigned char *)it) >= dataEnd)
|
||||
return -1;
|
||||
@@ -772,9 +772,9 @@ static void * doExport(const struct indexEntry_s *hindex, int indexUsed,
|
||||
count = entry->info.count;
|
||||
src = entry->data;
|
||||
while (count--) {
|
||||
- *((int32_t *)te) = htonl(*((int32_t *)src));
|
||||
- te += sizeof(int32_t);
|
||||
- src += sizeof(int32_t);
|
||||
+ *((uint32_t *)te) = htonl(*((uint32_t *)src));
|
||||
+ te += sizeof(uint32_t);
|
||||
+ src += sizeof(uint32_t);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -782,9 +782,9 @@ static void * doExport(const struct indexEntry_s *hindex, int indexUsed,
|
||||
count = entry->info.count;
|
||||
src = entry->data;
|
||||
while (count--) {
|
||||
- *((int16_t *)te) = htons(*((int16_t *)src));
|
||||
- te += sizeof(int16_t);
|
||||
- src += sizeof(int16_t);
|
||||
+ *((uint16_t *)te) = htons(*((uint16_t *)src));
|
||||
+ te += sizeof(uint16_t);
|
||||
+ src += sizeof(uint16_t);
|
||||
}
|
||||
break;
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
From 9841eed905b9433dc5d89583d34e4590842aa582 Mon Sep 17 00:00:00 2001
|
||||
From: Panu Matilainen <pmatilai@redhat.com>
|
||||
Date: Wed, 5 Oct 2022 09:21:09 +0300
|
||||
Subject: [PATCH] Permit building rpm from git without pandoc
|
||||
|
||||
Pandoc is only required for converting .md to man pages, which is not
|
||||
terribly interesting unless you're creating a dist tarball. We already
|
||||
have an automake conditional for pandoc, might as well use it.
|
||||
"make dist" will still fail without pandoc, but that's exactly how we
|
||||
want it.
|
||||
|
||||
(cherry picked from commit 1b8f7a182fe917ed5af5086d715cae529540a4d3)
|
||||
---
|
||||
docs/Makefile.am | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/docs/Makefile.am b/docs/Makefile.am
|
||||
index 89b92e3..a93b669 100644
|
||||
--- a/docs/Makefile.am
|
||||
+++ b/docs/Makefile.am
|
||||
@@ -1,8 +1,6 @@
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
-if PANDOC
|
||||
SUBDIRS = man
|
||||
-endif
|
||||
|
||||
EXTRA_DIST =
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
From 1f47b1cc0eddbb1921d81249a4bd604089c71495 Mon Sep 17 00:00:00 2001
|
||||
From: "(GalaxyMaster)" <galaxy4public@users.noreply.github.com>
|
||||
Date: Tue, 31 Jan 2023 18:24:55 +1100
|
||||
Subject: [PATCH] support for POSIX getopt() behaviour
|
||||
|
||||
[POSIX defines optarg only for options with arguments](https://pubs.opengroup.org/onlinepubs/000095399/functions/getopt.html) and callback() is expecting optarg to be NULL for options without arguments, however, at least on musl optarg will carry a pointer to the argument of the previous option with argument. This commit makes the behaviour deterministic and expected.
|
||||
---
|
||||
rpmio/rgetopt.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/rpmio/rgetopt.c b/rpmio/rgetopt.c
|
||||
index f789fa8fe..b14366a8a 100644
|
||||
--- a/rpmio/rgetopt.c
|
||||
+++ b/rpmio/rgetopt.c
|
||||
@@ -28,6 +28,7 @@ int rgetopt(int argc, char * const argv[], const char *opts,
|
||||
optind = 0;
|
||||
#else
|
||||
optind = 1;
|
||||
+ optarg = NULL;
|
||||
#endif
|
||||
|
||||
while ((c = getopt(argc, argv, opts)) != -1) {
|
||||
@@ -39,6 +40,7 @@ int rgetopt(int argc, char * const argv[], const char *opts,
|
||||
rc = -1;
|
||||
break;
|
||||
}
|
||||
+ optarg = NULL;
|
||||
}
|
||||
return (rc < 0) ? -optopt : optind;
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
diff --git a/rpm2cpio.c b/rpm2cpio.c
|
||||
index 89ebdfa..ae999ff 100644
|
||||
index 940d6ce..d34e899 100644
|
||||
--- a/rpm2cpio.c
|
||||
+++ b/rpm2cpio.c
|
||||
@@ -84,7 +84,12 @@ int main(int argc, char *argv[])
|
||||
@@ -94,7 +94,12 @@ int main(int argc, char *argv[])
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@ -14,5 +14,5 @@ index 89ebdfa..ae999ff 100644
|
||||
+ */
|
||||
+ rc = (ufdCopy(gzdi, fdo) >= payload_size) ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
|
||||
headerFree(h);
|
||||
Fclose(fdo);
|
||||
|
||||
|
||||
Binary file not shown.
BIN
rpm-4.18.1.tar.bz2
Normal file
BIN
rpm-4.18.1.tar.bz2
Normal file
Binary file not shown.
@ -17,13 +17,13 @@ Signed-off-by: wzx <wuzx1226@qq.com>
|
||||
7 files changed, 39 insertions(+)
|
||||
|
||||
diff --git a/build-aux/config.guess b/build-aux/config.guess
|
||||
index b33c9e8..69e3005 100755
|
||||
index c7f17e8..b67d636 100755
|
||||
--- a/build-aux/config.guess
|
||||
+++ b/build-aux/config.guess
|
||||
@@ -913,6 +913,14 @@ EOF
|
||||
@@ -976,6 +976,14 @@ EOF
|
||||
UNAME_MACHINE=aarch64_be
|
||||
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
|
||||
exit ;;
|
||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||
;;
|
||||
+ sw_64:Linux:*:*)
|
||||
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
+ sw) UNAME_MACHINE=sw_64 ;;
|
||||
@ -33,7 +33,7 @@ index b33c9e8..69e3005 100755
|
||||
+ echo "$UNAME_MACHINE"-sunway-linux-"$LIBC"
|
||||
+ exit ;;
|
||||
alpha:Linux:*:*)
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
|
||||
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
|
||||
EV5) UNAME_MACHINE=alphaev5 ;;
|
||||
diff --git a/build-aux/config.sub b/build-aux/config.sub
|
||||
index b51fb8c..84a8688 100755
|
||||
|
||||
45
rpm.spec
45
rpm.spec
@ -1,6 +1,6 @@
|
||||
Name: rpm
|
||||
Version: 4.18.0
|
||||
Release: 11
|
||||
Version: 4.18.1
|
||||
Release: 1
|
||||
Summary: RPM Package Manager
|
||||
License: GPLv2+
|
||||
URL: http://www.rpm.org/
|
||||
@ -18,29 +18,10 @@ Patch9: Add-loongarch-architecture-support.patch
|
||||
Patch10: rpm-Add-sw64-architecture.patch
|
||||
Patch11: add-default-machine-name-to-support-loongarch.patch
|
||||
|
||||
Patch6000: backport-Fix-header-leak-in-rpmInstall.patch
|
||||
Patch6001: backport-Fix-eiu-sourceURL-info-leak-in-rpmInstall.patch
|
||||
Patch6002: backport-Fix-h-blob-leak-when-installing-source-rpms.patch
|
||||
Patch6003: backport-Fix-Header-leak-when-running-rpm2cpio.patch
|
||||
Patch6004: backport-Use-unsigned-integers-more-consistently-in-the-handl.patch
|
||||
Patch6005: backport-Fix-file-leak-when-src-rpm-in-URL-format-is-used-for.patch
|
||||
Patch6006: backport-Fix-BANames-leak-in-handlePreambleTag.patch
|
||||
Patch6007: backport-Fix-prog-leak-in-parseScript.patch
|
||||
Patch6008: backport-Fix-elf-leak-in-getElfColor.patch
|
||||
Patch6009: backport-Fix-sbp-leak-when-running-rpmbuild-with-quiet.patch
|
||||
Patch6010: backport-Fix-memleak-when-running-generate_buildrequires.patch
|
||||
Patch6011: backport-Fix-memleak-when-fsmRename-failed-in-fsmCommit.patch
|
||||
Patch6012: backport-Fix-fileleak-and-memleak-in-rpmInstall.patch
|
||||
Patch6013: backport-Fix-fileleak-when-urlGetFile-fails-in-rpmInstall.patch
|
||||
|
||||
Patch6014: backport-Fix-install-of-block-and-character-special-files-219.patch
|
||||
Patch6015: backport-Use-fd-based-ops-for-metadata-in-FA_TOUCH-mode-too-w.patch
|
||||
Patch6016: backport-Add-a-test-for-special-device-node-installation.patch
|
||||
Patch6017: backport-support-for-POSIX-getopt-behaviour.patch
|
||||
Patch6018: backport-Use-proper-type-for-copyTagsFromMainDebug.patch
|
||||
Patch6019: backport-Fix-a-copy-paste-help-description-of-whatconflicts-R.patch
|
||||
Patch6020: backport-Fix-a-segfault-on-a-non-stringable-argument-to-macro.patch
|
||||
Patch6021: backport-Fix-per-file-plugin-hook-regression-introduced-in-4..patch
|
||||
Patch6000: backport-Fix-compiler-error-on-clang.patch
|
||||
Patch6001: backport-Move-variable-to-nearest-available-scope.patch
|
||||
Patch6002: backport-revert-Permit-building-rpm-from-git-without-pandoc.patch
|
||||
Patch6003: backport-Fix-per-file-plugin-hook-regression-introduced-in-4..patch
|
||||
|
||||
Patch9000: Add-digest-list-plugin.patch
|
||||
Patch9001: Add-IMA-digest-list-support.patch
|
||||
@ -160,21 +141,14 @@ done;
|
||||
--enable-sqlite=no \
|
||||
--with-crypto=openssl \
|
||||
--with-fapolicyd=no \
|
||||
--with-fsverity=no
|
||||
--with-fsverity=no \
|
||||
--enable-python
|
||||
|
||||
%make_build
|
||||
|
||||
pushd python
|
||||
%{__python3} setup.py build
|
||||
popd
|
||||
|
||||
%install
|
||||
%make_install
|
||||
|
||||
pushd python
|
||||
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
|
||||
popd
|
||||
|
||||
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily
|
||||
install -m 755 scripts/rpm.daily ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm
|
||||
|
||||
@ -330,6 +304,9 @@ make clean
|
||||
%exclude %{_mandir}/man8/rpmspec.8.gz
|
||||
|
||||
%changelog
|
||||
* Tue Jun 20 2023 renhongxun<renhongxun@h-partners.com> - 4.18.1-1
|
||||
- upgrade version to 4.18.1
|
||||
|
||||
* Wed Jun 21 2023 renhongxun<renhongxun@h-partners.com> - 4.18.0-11
|
||||
- Fix per-file plugin hook regression introduced in 4.18
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user