diff --git a/SOURCES/1381.patch b/SOURCES/1381.patch new file mode 100644 index 0000000..dd1a649 --- /dev/null +++ b/SOURCES/1381.patch @@ -0,0 +1,23 @@ +From 7ae16d6bd37abdcc0430fbb1b25a0f821a60c234 Mon Sep 17 00:00:00 2001 +From: Matthew Almond +Date: Mon, 28 Sep 2020 12:41:22 -0700 +Subject: [PATCH] Make fdSeek return 0 on success, -1 on error + +This code eliminates a false positive failure when the destination position is > 2GiB. This is done by changing the contract for `Fseek`. Now it returns `0` on success instead of an `int` offset. Care should be used to interpret the result as there is a difference in semantics between the POSIX `fseek(2)`. Existing code is correct: negative results are still failures. +--- + rpmio/rpmio.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c +index 10a28a923..9f4a60aa1 100644 +--- a/rpmio/rpmio.c ++++ b/rpmio/rpmio.c +@@ -382,7 +382,7 @@ static ssize_t fdWrite(FDSTACK_t fps, const void * buf, size_t count) + + static int fdSeek(FDSTACK_t fps, off_t pos, int whence) + { +- return lseek(fps->fdno, pos, whence); ++ return (lseek(fps->fdno, pos, whence) == -1) ? -1 : 0; + } + + static int fdClose(FDSTACK_t fps) diff --git a/SPECS/rpm.spec b/SPECS/rpm.spec index e55b2df..fc934cc 100644 --- a/SPECS/rpm.spec +++ b/SPECS/rpm.spec @@ -11,9 +11,9 @@ # build with libarchive? (needed for rpm2archive) %bcond_without libarchive # build with libimaevm.so -%bcond_without libimaevm +%bcond_with libimaevm # build with new db format -%bcond_with ndb +%bcond_without ndb # build with zstd support? %bcond_without zstd # build with lmdb support? @@ -137,6 +137,8 @@ Patch1001: compile-with-Platform-Python-binary-where-relevant.patch # make unversioned %%__python an error unless explicitly overridden Patch1002: rpm-4.14.2-unversioned-python.patch +Patch9998: https://github.com/rpm-software-management/rpm/pull/1381.patch +Provides: rpm(pr1381) Patch9999: https://github.com/rpm-software-management/rpm/pull/1470.patch Provides: rpm(pr1470) @@ -696,6 +698,7 @@ make check || cat tests/rpmtests.log %changelog * Thu Mar 18 2021 Matthew Almond - 4.14.3-13.1 +- PR1381 (Fix Fseek for offset > 2GiB) - PR1470 (CoW) * Fri Feb 12 2021 Michal Domonkos - 4.14.3-13