Compare commits

...

13 Commits
master ... f16

Author SHA1 Message Date
Panu Matilainen 38f5300bee - update to 4.1.9.3 (http://rpm.org/wiki/Releases/4.9.1.3)
- fixes CVE-2012-0060, CVE-2012-0061 and CVE-2012-0815
2012-04-03 18:42:34 +03:00
Panu Matilainen f4871d32dc - fix memory corruption on rpmdb size estimation (#766260)
- fix couple of memleaks in python bindings (#782147)
- fix regression in verify output formatting (#797964)
- dont process spec include in false branch of if (#782970)
- only warn on missing excluded files on build (#745629)
- dont free up file info sets on test transactions
2012-03-07 13:21:23 +02:00
Panu Matilainen 71fdeb3726 - remember to bump the actual release, doh 2012-02-09 10:21:51 +02:00
Panu Matilainen 8f9ca3ec10 - adjust font detection rules for libmagic change (#757105)
- fix classification of ELF binaries with setuid/setgid bit (#758251)
- switch back to smaller BDB cache default (#752897)
2012-02-09 10:18:42 +02:00
Kay Sievers 069c468098 add temporary rpmlib patch to support filesystem transition
https://fedorahosted.org/fpc/ticket/118#comment:14
2012-01-24 19:17:47 +01:00
Karsten Hopp 40c2180147 bump release 2011-12-15 16:58:46 +01:00
Karsten Hopp 4efb0e5b07 warn but dont fail the build if STABS encountered by debugedit
(#725378, Panu Matilainen)
2011-12-15 16:56:04 +01:00
Dennis Gilmore d481dd5595 conditionally apply arm patch for hardfp on all arches but arm softfp ones
Conflicts:

	rpm.spec
2011-11-30 09:56:10 -06:00
Panu Matilainen bdde24ae3e Merge branch 'master' into f16
* master:
  - update to 4.9.1.2 (CVE-2011-3378) - drop upstreamed rpmdb signal patch
2011-09-29 16:51:46 +03:00
Panu Matilainen 164bb599e0 Merge branch 'master' into f16
* master:
  - fix signal blocking/unblocking regression on rpmdb open/close (#739492)
2011-09-19 13:20:56 +03:00
Panu Matilainen 839293f509 Merge branch 'master' into f16 2011-08-15 13:06:21 +03:00
Panu Matilainen 4fff596509 Revert "Add RPM_LD_FLAGS to build environment (#728974)"
This reverts commit 5594634579 temporarily
to get a saner merge with rawhide..
2011-08-15 13:06:02 +03:00
Adam Jackson 5594634579 Add RPM_LD_FLAGS to build environment (#728974)
Conflicts:

	rpm.spec
2011-08-08 10:37:22 -04:00
15 changed files with 773 additions and 2 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ rpm-4.8.1.tar.bz2
/rpm-4.9.1.tar.bz2
/rpm-4.9.1.1.tar.bz2
/rpm-4.9.1.2.tar.bz2
/rpm-4.9.1.3.tar.bz2

156
rpm-4.9.0-armhfp.patch Normal file
View File

@ -0,0 +1,156 @@
diff -uNr rpm-4.9.0-orig//installplatform rpm-4.9.0/installplatform
--- rpm-4.9.0-orig//installplatform 2010-12-03 06:11:57.000000000 -0600
+++ rpm-4.9.0/installplatform 2011-08-05 12:25:13.000000000 -0500
@@ -19,7 +19,7 @@
case "$arch" in
i[3456]86|pentium[34]|athlon|geode) SUBSTS='s_i386_i386_ s_i386_i486_ s_i386_i586_ s_i386_i686_ s_i386_pentium3_ s_i386_pentium4_ s_i386_athlon_ s_i386_geode_' ;;
alpha*) SUBSTS='s_alpha_alpha_ s_alpha_alphaev5_ s_alpha_alphaev56_ s_alpha_alphapca56_ s_alpha_alphaev6_ s_alpha_alphaev67_' ;;
- arm*) SUBSTS='s_arm_arm_ s_arm_armv3l_ s_arm_armv4l_ s_arm_armv4tl_ s_arm_armv5tel_ s_arm_armv5tejl_ s_arm_armv6l_ s_arm_armv7l_' ;;
+ arm*) SUBSTS='s_arm_arm_ s_arm_armv3l_ s_arm_armv4l_ s_arm_armv4tl_ s_arm_armv5tel_ s_arm_armv5tejl_ s_arm_armv6l_ s_arm_armv7l_ s_arm_armv7hl_ s_arm_armv7hnl_' ;;
sh4*) SUBSTS='s_sh4_sh4_ s_sh4_sh4a_' ;;
sparc*) SUBSTS='s_sparc\(64\|64v\|v9v\|v9\)_sparc_ s_sparc64_sparcv9_;s_sparc\([^v]\|$\)_sparcv9\1_ s_sparcv9_sparc64_;s_sparc\([^6]\|$\)_sparc64\1_' ;;
powerpc*|ppc*) SUBSTS='s_ppc64_ppc_ s_ppc\([^6ip]\|$\)_ppc64\1_ s_ppc\([^6ip]\|$\)_ppciseries_ s_ppc\([^6ip]\|$\)_ppcpseries_ s_ppc\([^6ip]\|$\)_ppc64iseries_ s_ppc\([^6ip]\|$\)_ppc64pseries_' ;;
diff -uNr rpm-4.9.0-orig//lib/rpmrc.c rpm-4.9.0/lib/rpmrc.c
--- rpm-4.9.0-orig//lib/rpmrc.c 2011-08-05 12:23:04.000000000 -0500
+++ rpm-4.9.0/lib/rpmrc.c 2011-08-05 12:25:13.000000000 -0500
@@ -732,6 +732,56 @@
}
#endif
+#if defined(__linux__) && defined(__arm__)
+static int has_neon()
+{
+ char buffer[4096], *p;
+ int fd = open("/proc/cpuinfo", O_RDONLY);
+ if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
+ rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n"));
+ close(fd);
+ return 0;
+ }
+ close(fd);
+
+ p = strstr(buffer, "Features");
+ p = strtok(p, "\n");
+ p = strstr(p, "neon");
+ p = strtok(p, " ");
+ if (p == NULL) {
+ rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'Features' line\n"));
+ return 0;
+ } else if (strcmp(p, "neon") == 0) {
+ return 1;
+ }
+ return 0;
+}
+
+static int has_hfp()
+{
+ char buffer[4096], *p;
+ int fd = open("/proc/cpuinfo", O_RDONLY);
+ if (read(fd, &buffer, sizeof(buffer) - 1) == -1) {
+ rpmlog(RPMLOG_WARNING, _("read(/proc/cpuinfo) failed\n"));
+ close(fd);
+ return 0;
+ }
+ close(fd);
+
+ p = strstr(buffer, "Features");
+ p = strtok(p, "\n");
+ p = strstr(p, "vfpv3");
+ p = strtok(p, " ");
+ if (p == NULL) {
+ rpmlog(RPMLOG_WARNING, _("/proc/cpuinfo has no 'Features' line\n"));
+ return 0;
+ } else if (strcmp(p, "vfpv3") == 0) {
+ return 1;
+ }
+ return 0;
+}
+#endif
+
# if defined(__linux__) && defined(__i386__)
#include <setjmp.h>
@@ -1157,6 +1207,22 @@
}
# endif /* sparc*-linux */
+# if defined(__linux__) && defined(__arm__)
+ {
+ if (strcmp(un.machine, "armv7l") == 0 ) {
+ if (has_neon() && has_hfp())
+ strcpy(un.machine, "armv7hnl");
+ else if (has_hfp())
+ strcpy(un.machine, "armv7hl");
+ } else if (strcmp(un.machine, "armv6l") == 0 ) {
+ if (has_neon() && has_hfp())
+ strcpy(un.machine, "armv6hnl");
+ else if (has_hfp())
+ strcpy(un.machine, "armv6hl");
+ }
+ }
+# endif /* arm*-linux */
+
# if defined(__GNUC__) && defined(__alpha__)
{
unsigned long amask, implver;
diff -uNr rpm-4.9.0-orig//macros.in rpm-4.9.0/macros.in
--- rpm-4.9.0-orig//macros.in 2011-08-05 12:23:04.000000000 -0500
+++ rpm-4.9.0/macros.in 2011-08-05 12:25:13.000000000 -0500
@@ -1032,7 +1032,7 @@
#------------------------------------------------------------------------------
# arch macro for all supported ARM processors
-%arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l
+%arm armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l armv7hl armv7hnl
#------------------------------------------------------------------------------
# arch macro for all supported Sparc processors
diff -uNr rpm-4.9.0-orig//rpmrc.in rpm-4.9.0/rpmrc.in
--- rpm-4.9.0-orig//rpmrc.in 2011-08-05 12:23:04.000000000 -0500
+++ rpm-4.9.0/rpmrc.in 2011-08-05 12:26:34.000000000 -0500
@@ -66,6 +66,8 @@
optflags: armv5tejl -O2 -g -march=armv5te
optflags: armv6l -O2 -g -march=armv6
optflags: armv7l -O2 -g -march=armv7
+optflags: armv7hl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb
+optflags: armv7hnl -O2 -g -march=armv7-a -mfloat-abi=hard -mfpu=neon -mthumb
optflags: atarist -O2 -g -fomit-frame-pointer
optflags: atariste -O2 -g -fomit-frame-pointer
@@ -140,6 +142,8 @@
arch_canon: armv5tejl: armv5tejl 12
arch_canon: armv6l: armv6l 12
arch_canon: armv7l: armv7l 12
+arch_canon: armv7hl: armv7hl 12
+arch_canon: armv7hnl: armv7hnl 12
arch_canon: m68kmint: m68kmint 13
arch_canon: atarist: m68kmint 13
@@ -248,6 +252,8 @@
buildarchtranslate: armv5tejl: armv5tejl
buildarchtranslate: armv6l: armv6l
buildarchtranslate: armv7l: armv7l
+buildarchtranslate: armv7hl: armv7hl
+buildarchtranslate: armv7hnl: armv7hnl
buildarchtranslate: atarist: m68kmint
buildarchtranslate: atariste: m68kmint
@@ -336,6 +342,8 @@
arch_compat: armv4tl: armv4l
arch_compat: armv4l: armv3l
arch_compat: armv3l: noarch
+arch_compat: armv7hnl: armv7hl
+arch_compat: armv7hl: noarch
arch_compat: atarist: m68kmint noarch
arch_compat: atariste: m68kmint noarch
@@ -441,6 +449,9 @@
buildarch_compat: armv4l: armv3l
buildarch_compat: armv3l: noarch
+buildarch_compat: armv7hnl: armv7hl
+buildarch_compat: armv7hl: noarch
+
buildarch_compat: hppa2.0: hppa1.2
buildarch_compat: hppa1.2: hppa1.1
buildarch_compat: hppa1.1: hppa1.0

View File

@ -0,0 +1,127 @@
diff --git a/lib/depends.c b/lib/depends.c
index 69aecbb..5101d32 100644
--- a/lib/depends.c
+++ b/lib/depends.c
@@ -386,6 +386,108 @@ static int rpmdbProvides(rpmts ts, depCache dcache, rpmds dep)
return rc;
}
+/*
+ * Temporary support for live-conversion of the filesystem hierarchy
+ * mailto: kay@redhat.com, harald@redhat.com
+ * https://fedoraproject.org/wiki/Features/UsrMove
+ *
+ * X-CheckUnifiedSystemdir:
+ * /bin, /sbin, /lib, /lib64 --> /usr
+ *
+ * X-CheckUnifiedBindir:
+ * /usr/sbin -> /usr/bin
+ *
+ * X-CheckMultiArchLibdir:
+ * /usr/lib64 /usr/lib/<platform tuple> (e.g. x86_64-linux-gnu)
+ *
+ * This code is not needed for new installations, it can be removed after
+ * updates from older systems are no longer supported: Fedora 19 / RHEL 8.
+ */
+
+static int CheckLink(const char *dir, const char *root)
+{
+ char *d = NULL;
+ struct stat sbuf;
+ int rc = 0;
+
+ if (!root)
+ root = "/";
+
+ rasprintf(&d, "%s%s", root, dir);
+ if (!d) {
+ rc = -1;
+ goto exit;
+ }
+
+ /* directory or symlink does not exist, all is fine */
+ if (lstat(d, &sbuf) < 0) {
+ rc = 1;
+ goto exit;
+ }
+
+ /* if it is a symlink, all is fine */
+ if (S_ISLNK(sbuf.st_mode))
+ rc = 1;
+
+exit:
+ free(d);
+ return rc;
+}
+
+static int CheckFilesystemHierarchy(rpmds * dsp, const char *root)
+{
+ static const char *dirs[] = { "bin", "sbin", "lib", "lib64" };
+ int check;
+ int i;
+ rpmds ds;
+ int rc = 0;
+
+ for (i = 0; i < sizeof(dirs) / sizeof(dirs[0]); i++) {
+ check = CheckLink(dirs[i], root);
+ if (check < 0) {
+ rc = -1;
+ goto exit;
+ }
+
+ if (check == 0)
+ goto exit;
+ }
+ ds = rpmdsSingle(RPMTAG_PROVIDENAME,
+ "rpmlib(X-CheckUnifiedSystemdir)", "1",
+ RPMSENSE_EQUAL);
+ rpmdsMerge(dsp, ds);
+ rpmdsFree(ds);
+
+ check = CheckLink("usr/lib64", root);
+ if (check < 0) {
+ rc = -1;
+ goto exit;
+ }
+ if (check > 0) {
+ ds = rpmdsSingle(RPMTAG_PROVIDENAME,
+ "rpmlib(X-CheckMultiArchLibdir)", "1",
+ RPMSENSE_EQUAL);
+ rpmdsMerge(dsp, ds);
+ rpmdsFree(ds);
+ }
+
+ check = CheckLink("usr/sbin", root);
+ if (check < 0) {
+ rc = -1;
+ goto exit;
+ }
+ if (check > 0) {
+ ds = rpmdsSingle(RPMTAG_PROVIDENAME,
+ "rpmlib(X-CheckUnifiedBindir)", "1",
+ RPMSENSE_EQUAL);
+ rpmdsMerge(dsp, ds);
+ rpmdsFree(ds);
+ }
+
+exit:
+ return rc;
+}
+
/**
* Check dep for an unsatisfied dependency.
* @param ts transaction set
@@ -410,9 +512,11 @@ retry:
*/
if (dsflags & RPMSENSE_RPMLIB) {
static int oneshot = -1;
- if (oneshot)
+ if (oneshot) {
oneshot = rpmdsRpmlib(&rpmlibP, NULL);
-
+ CheckFilesystemHierarchy(&rpmlibP, rpmtsRootDir(ts));
+ }
+
if (rpmlibP != NULL && rpmdsSearch(rpmlibP, dep) >= 0) {
rpmdsNotify(dep, "(rpmlib provides)", rc);
goto exit;

View File

@ -0,0 +1,13 @@
diff --git a/tools/debugedit.c b/tools/debugedit.c
index 89d0428..dc424d3 100644
--- a/tools/debugedit.c
+++ b/tools/debugedit.c
@@ -1586,7 +1586,7 @@ main (int argc, char *argv[])
if (strcmp (name, ".stab") == 0)
{
fprintf (stderr, "Stabs debuginfo not supported: %s\n", file);
- exit (1);
+ break;
}
if (strcmp (name, ".debug_info") == 0)
edit_dwarf2 (dso);

16
rpm-4.9.x-elfattr.patch Normal file
View File

@ -0,0 +1,16 @@
commit 87d9e3c4adac92ff544440dd1239a4ae4fe05bb4
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Mon Nov 28 14:00:45 2011 +0200
Fix classification of ELF binaries with setuid/setgid bit, oops...
diff --git a/fileattrs/elf.attr b/fileattrs/elf.attr
index bc6ce83..595b33e 100644
--- a/fileattrs/elf.attr
+++ b/fileattrs/elf.attr
@@ -1,4 +1,4 @@
%__elf_provides %{_rpmconfigdir}/elfdeps --provides %{?__filter_GLIBC_PRIVATE:--filter-private}
%__elf_requires %{_rpmconfigdir}/elfdeps --requires %{?__filter_GLIBC_PRIVATE:--filter-private}
-%__elf_magic ^(sticky )?ELF (32|64)-bit.*$
+%__elf_magic ^(setuid )?(setgid )?(sticky )?ELF (32|64)-bit.*$
%__elf_flags exeonly

View File

@ -0,0 +1,59 @@
commit cce686b2129e4e8dc27f1a640f7c4746f9ffb032
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Sun Oct 23 13:59:46 2011 +0300
Warn but don't fail the build on missing excluded files (RhBug:745629)
- If a file/directory is not to be packaged, there's not a whole lot
point making the build fail if its missing. In case exclude is
used to leave certain files to sub-packages, the sub-package file
lists will catch out missing files that are really missing as a
result of actual build failure or such (except perhaps for some
glob cases but missing files can go unnoticed in those cases anyway)
- backported from commit 084a00bf51a941ec85c094a436bda401fccf7d3a
diff --git a/build/files.c b/build/files.c
index e0747f8..a520410 100644
--- a/build/files.c
+++ b/build/files.c
@@ -1393,12 +1393,19 @@ static rpmRC addFile(FileList fl, const char * diskPath,
statp->st_mtime = now;
statp->st_ctime = now;
} else {
+ int rc = RPMRC_FAIL;
+ int lvl = RPMLOG_ERR;
const char *msg = fl->isDir ?
_("Directory not found: %s\n") :
_("File not found: %s\n");
- rpmlog(RPMLOG_ERR, msg, diskPath);
- fl->processingFailed = 1;
- return RPMRC_FAIL;
+ if (fl->currentFlags & RPMFILE_EXCLUDE) {
+ lvl = RPMLOG_WARNING;
+ rc = RPMRC_OK;
+ } else {
+ fl->processingFailed = 1;
+ }
+ rpmlog(lvl, msg, diskPath);
+ return rc;
}
}
}
@@ -1702,11 +1707,15 @@ static rpmRC processBinaryFile(Package pkg, FileList fl, const char * fileName)
}
argvFree(argv);
} else {
+ int lvl = RPMLOG_WARNING;
const char *msg = (fl->isDir) ?
_("Directory not found by glob: %s\n") :
_("File not found by glob: %s\n");
- rpmlog(RPMLOG_ERR, msg, diskPath);
- rc = RPMRC_FAIL;
+ if (!(fl->currentFlags & RPMFILE_EXCLUDE)) {
+ lvl = RPMLOG_ERR;
+ rc = RPMRC_FAIL;
+ }
+ rpmlog(lvl, msg, diskPath);
goto exit;
}
} else {

15
rpm-4.9.x-fontattr.patch Normal file
View File

@ -0,0 +1,15 @@
commit fb30c0aac8b3da8c75a8cb1578a719ce38db59eb
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Fri Nov 25 16:07:38 2011 +0200
Identify "font collection" (data etc) as fonts also (RhBug:757105)
diff --git a/fileattrs/font.attr b/fileattrs/font.attr
index 5c4c78f..8c19383 100644
--- a/fileattrs/font.attr
+++ b/fileattrs/font.attr
@@ -1,3 +1,3 @@
%__font_provides %{_rpmconfigdir}/fontconfig.prov
%__font_requires %{nil}
-%__font_magic ^.* [Ff]ont (program )?(text|data).*$
+%__font_magic ^.* [Ff]ont (program|collection )?(text|data).*$

View File

@ -0,0 +1,21 @@
commit bf92b843fabd6c9881b19efb0cae1578d16e4f7b
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Tue Feb 28 12:18:10 2012 +0200
Don't process spec %include in false branch of %if clauses (RhBug:782970)
(backported from commit 9defc922e971d98203890f1557ab951ec94f2a3f)
diff --git a/build/parseSpec.c b/build/parseSpec.c
index 01620bd..01c3c08 100644
--- a/build/parseSpec.c
+++ b/build/parseSpec.c
@@ -374,7 +374,8 @@ int readLine(rpmSpec spec, int strip)
spec->readStack = spec->readStack->next;
free(rl);
spec->line[0] = '\0';
- } else if (rstreqn("%include", s, sizeof("%include")-1)) {
+ } else if (spec->readStack->reading &&
+ rstreqn("%include", s, sizeof("%include")-1)) {
char *fileName, *endFileName, *p;
s += 8;

28
rpm-4.9.x-mpsize.patch Normal file
View File

@ -0,0 +1,28 @@
commit d8cd36058b528f56bd579204426143be1e1eac6d
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Wed Feb 8 10:56:09 2012 +0200
Switch back to former, much smaller BDB memory pool size (RhBug:752897)
- A larger cache is beneficial in various scenarios, but triggers
horrible worst-case performance under memory pressure (or so my
current theory goes, there might be other factors too). The
worst-case degration is orders of magnitude bigger than the best-case
improvements from the larger cache and for many use-cases doesn't
make a whole lot difference. We could/should tune the cache with
priorizing indexes and all, and perhaps dynamically select the
cache size but for now, the 1Mb cache size is known to "just work".
diff --git a/macros.in b/macros.in
index f835fec..6034721 100644
--- a/macros.in
+++ b/macros.in
@@ -535,7 +535,7 @@ print (t)\
#
# Misc BDB tuning options
-%__dbi_other mp_mmapsize=128Mb mp_size=64Mb
+%__dbi_other mp_mmapsize=128Mb mp_size=1Mb
%_dbi_config %{?__dbi_other}

View File

@ -0,0 +1,66 @@
commit 59807943af5c10c892b239f11b8fafb209254a4a
Author: David Malcolm <dmalcolm@redhat.com>
Date: Thu Dec 15 22:22:56 2011 -0500
fix memory leaks in invocations of PyObject_Call
- Various functions in the Python bindings have expressions of the form:
PyObject_Call(callable,
Py_BuildValue(fmtstring, ...), NULL);
This leaks memory for the case when Py_BuildValue succeeds (it returns a
new reference, which is never freed; PyObject_Call doesn't steal the
reference): the argument tuple and all of its components will not be
freed (until the process exits).
Signed-off-by: Ales Kozumplik <akozumpl@redhat.com>
diff --git a/python/header-py.c b/python/header-py.c
index 96cf200..cef457b 100644
--- a/python/header-py.c
+++ b/python/header-py.c
@@ -295,8 +295,7 @@ static PyObject * hdrWrite(hdrObject *s, PyObject *args, PyObject *kwds)
*/
static PyObject * hdr_fiFromHeader(PyObject * s, PyObject * args, PyObject * kwds)
{
- return PyObject_Call((PyObject *) &rpmfi_Type,
- Py_BuildValue("(O)", s), NULL);
+ return PyObject_CallFunctionObjArgs((PyObject *) &rpmfi_Type, s, NULL);
}
/* Backwards compatibility. Flags argument is just a dummy and discarded. */
@@ -309,14 +308,14 @@ static PyObject * hdr_dsFromHeader(PyObject * s, PyObject * args, PyObject * kwd
tagNumFromPyObject, &tag, &flags))
return NULL;
- return PyObject_Call((PyObject *) &rpmds_Type,
- Py_BuildValue("(Oi)", s, tag), NULL);
+ return PyObject_CallFunction((PyObject *) &rpmds_Type,
+ "(Oi)", s, tag);
}
static PyObject * hdr_dsOfHeader(PyObject * s)
{
- return PyObject_Call((PyObject *) &rpmds_Type,
- Py_BuildValue("(Oi)", s, RPMTAG_NEVR), NULL);
+ return PyObject_CallFunction((PyObject *) &rpmds_Type,
+ "(Oi)", s, RPMTAG_NEVR);
}
static long hdr_hash(PyObject * h)
diff --git a/python/rpmfd-py.c b/python/rpmfd-py.c
index 89a70cd..1150aa1 100644
--- a/python/rpmfd-py.c
+++ b/python/rpmfd-py.c
@@ -23,8 +23,8 @@ int rpmfdFromPyObject(PyObject *obj, rpmfdObject **fdop)
Py_INCREF(obj);
fdo = (rpmfdObject *) obj;
} else {
- fdo = (rpmfdObject *) PyObject_Call((PyObject *)&rpmfd_Type,
- Py_BuildValue("(O)", obj), NULL);
+ fdo = (rpmfdObject *) PyObject_CallFunctionObjArgs((PyObject *)&rpmfd_Type,
+ obj, NULL);
}
if (fdo == NULL) return 0;

98
rpm-4.9.x-rpmdb-dsi.patch Normal file
View File

@ -0,0 +1,98 @@
diff --git a/lib/transaction.c b/lib/transaction.c
index 7adf60b..5acc08e 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -227,46 +227,12 @@ static void rpmtsUpdateDSI(const rpmts ts, dev_t dev, const char *dirName,
if (dsi->ineeded < dsi->oineeded) dsi->oineeded = dsi->ineeded;
}
-/* return DSI of the device the rpmdb lives on */
-static rpmDiskSpaceInfo rpmtsDbDSI(const rpmts ts) {
- const char *dbhome = rpmdbHome(rpmtsGetRdb(ts));
- struct stat sb;
- int rc;
-
- rc = stat(dbhome, &sb);
- if (rc) {
- return NULL;
- }
- return rpmtsGetDSI(ts, sb.st_dev, dbhome);
-}
-
-/* Update DSI for changing size of the rpmdb */
-static void rpmtsUpdateDSIrpmDBSize(const rpmte p,
- rpmDiskSpaceInfo dsi) {
- rpm_loff_t headerSize;
- int64_t bneeded;
-
- /* XXX somehow we can end up here with bsize 0 (RhBug:671056) */
- if (dsi == NULL || dsi->bsize == 0) return;
-
- headerSize = rpmteHeaderSize(p);
- bneeded = BLOCK_ROUND(headerSize, dsi->bsize);
- /* REMOVE doesn't neccessarily shrink the database */
- if (rpmteType(p) == TR_ADDED) {
- /* guessing that db grows 4 times more than the header size */
- dsi->bneeded += (bneeded * 4);
- }
-}
-
-
static void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
{
rpmDiskSpaceInfo dsi = ts->dsi;
if (dsi == NULL || !dsi->bsize)
return;
- if (rpmfiFC(rpmteFI(te)) <= 0)
- return;
for (; dsi->bsize; dsi++) {
@@ -1294,11 +1260,12 @@ static int rpmtsPrepare(rpmts ts)
rpmfi fi;
int rc = 0;
uint64_t fileCount = countFiles(ts);
+ const char *dbhome = NULL;
+ struct stat dbstat;
fingerPrintCache fpc = fpCacheCreate(fileCount/2 + 10001);
rpmFpHash ht = rpmFpHashCreate(fileCount/2+1, fpHashFunction, fpEqual,
NULL, NULL);
- rpmDiskSpaceInfo dsi;
rpmlog(RPMLOG_DEBUG, "computing %" PRIu64 " file fingerprints\n", fileCount);
@@ -1326,7 +1293,10 @@ static int rpmtsPrepare(rpmts ts)
/* check against files in the rpmdb */
checkInstalledFiles(ts, fileCount, ht, fpc);
- dsi = rpmtsDbDSI(ts);
+ dbhome = rpmdbHome(rpmtsGetRdb(ts));
+ /* If we can't stat, ignore db growth. Probably not right but... */
+ if (dbhome && stat(dbhome, &dbstat))
+ dbhome = NULL;
pi = rpmtsiInit(ts);
while ((p = rpmtsiNext(pi, 0)) != NULL) {
@@ -1338,10 +1308,18 @@ static int rpmtsPrepare(rpmts ts)
needs on each partition for this package. */
handleOverlappedFiles(ts, ht, p, fi);
- rpmtsUpdateDSIrpmDBSize(p, dsi);
-
/* Check added package has sufficient space on each partition used. */
if (rpmteType(p) == TR_ADDED) {
+ /*
+ * Try to estimate space needed for rpmdb growth: guess that the
+ * db grows 4 times the header size (indexes and all).
+ */
+ if (dbhome) {
+ int64_t hsize = rpmteHeaderSize(p) * 4;
+ rpmtsUpdateDSI(ts, dbstat.st_dev, dbhome,
+ hsize, 0, 0, FA_CREATE);
+ }
+
rpmtsCheckDSIProblems(ts, p);
}
(void) rpmswExit(rpmtsOp(ts, RPMTS_OP_FINGERPRINT), 0);

View File

@ -0,0 +1,43 @@
commit 7d88d5e54a9c3fa2b7fb443921c8adb799051784
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Wed Feb 1 17:48:20 2012 +0200
Don't free up file info sets on transaction test-runs
- We'd like to get rid of the potentially huge amounts of memory
eaten by file info sets as early as possible, but when there's a
chance that we'll get called again with either added transacation
elements or on-disk changes, such as %pretrans changing something
underneath us, we need to (be able to) recalculate everything
from scratch. Only free up the memory when we know we dont need
it anymore, ie on an actual transaction run.
- This doesn't change anything for rpm itself, for yum and others
which do a separate test-transaction first, it means %pretrans
directory<->symlink replacement hacks and the like have a chance
of working again. I'm sure there's a bug filed on this somewhere but...
(cherry picked from commit cef18c94807af0935b7796c462aab8ed39f0f376)
diff --git a/lib/transaction.c b/lib/transaction.c
index 56ebc17..8d29ab9 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -1355,12 +1355,14 @@ static int rpmtsPrepare(rpmts ts)
if (rpmChrootOut())
rc = -1;
- /* File info sets, fp caches etc not needed beyond here, free 'em up. */
- pi = rpmtsiInit(ts);
- while ((p = rpmtsiNext(pi, 0)) != NULL) {
- rpmteSetFI(p, NULL);
+ /* On actual transaction, file info sets are not needed after this */
+ if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_TEST|RPMTRANS_FLAG_BUILD_PROBS))) {
+ pi = rpmtsiInit(ts);
+ while ((p = rpmtsiNext(pi, 0)) != NULL) {
+ rpmteSetFI(p, NULL);
+ }
+ rpmtsiFree(pi);
}
- pi = rpmtsiFree(pi);
exit:
ht = rpmFpHashFree(ht);

View File

@ -0,0 +1,62 @@
commit 4e207bfdfce434a6484babc14fe86aeadeec5329
Author: Panu Matilainen <pmatilai@redhat.com>
Date: Tue Feb 28 10:31:28 2012 +0200
Unbreak rpm -V output (RhBug:797964)
- Commit ac0ab016a5ec31e65eb0c0910a5a6f1199aae3e7 unintentionally
changed the order of the problems shown in verify strings due to
a dumb oversight (greetings to self, duh). In other words, this
fixes a verify output regression in rpm >= 4.9.x by restoring
the long-standing (and documented) order of the verify output chars.
- Also fix the testcase which unfortunately was only added after
the output-changing commit so it didn't catch the breakage either :-/
diff --git a/lib/verify.c b/lib/verify.c
index 35612fe..1edb27f 100644
--- a/lib/verify.c
+++ b/lib/verify.c
@@ -292,14 +292,14 @@ char * rpmVerifyString(uint32_t verifyResult, const char *pad)
{
char *fmt = NULL;
rasprintf(&fmt, "%s%s%s%s%s%s%s%s%s",
- _verifyfile(RPMVERIFY_FILEDIGEST, "5", pad),
_verify(RPMVERIFY_FILESIZE, "S", pad),
- _verifylink(RPMVERIFY_LINKTO, "L", pad),
- _verify(RPMVERIFY_MTIME, "T", pad),
+ _verify(RPMVERIFY_MODE, "M", pad),
+ _verifyfile(RPMVERIFY_FILEDIGEST, "5", pad),
_verify(RPMVERIFY_RDEV, "D", pad),
+ _verifylink(RPMVERIFY_LINKTO, "L", pad),
_verify(RPMVERIFY_USER, "U", pad),
_verify(RPMVERIFY_GROUP, "G", pad),
- _verify(RPMVERIFY_MODE, "M", pad),
+ _verify(RPMVERIFY_MTIME, "T", pad),
_verify(RPMVERIFY_CAPS, "P", pad));
return fmt;
diff --git a/tests/rpmverify.at b/tests/rpmverify.at
index dd23a4a..77d6bfe 100644
--- a/tests/rpmverify.at
+++ b/tests/rpmverify.at
@@ -79,7 +79,7 @@ dd if=/dev/zero of="${RPMTEST}"/usr/local/bin/hello \
runroot rpm -Va --nodeps --nouser --nogroup
],
[1],
-[5..T...M. /usr/local/bin/hello
+[.M5....T. /usr/local/bin/hello
missing d /usr/share/doc/hello-1.0/FAQ
],
[])
diff -up rpm-4.9.1.2/tests/rpmtests.verify-output rpm-4.9.1.2/tests/rpmtests
--- rpm-4.9.1.2/tests/rpmtests.verify-output 2012-03-07 12:20:31.889830559 +0200
+++ rpm-4.9.1.2/tests/rpmtests 2012-03-07 12:21:01.651753987 +0200
@@ -3619,7 +3619,7 @@ runroot rpm -Va --nodeps --nouser --nogr
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
-echo >>"$at_stdout"; $as_echo "5..T...M. /usr/local/bin/hello
+echo >>"$at_stdout"; $as_echo ".M5....T. /usr/local/bin/hello
missing d /usr/share/doc/hello-1.0/FAQ
" | \
$at_diff - "$at_stdout" || at_failed=:

View File

@ -11,7 +11,7 @@
%define rpmhome /usr/lib/rpm
%define rpmver 4.9.1.2
%define rpmver 4.9.1.3
%define srcver %{rpmver}%{?snapver:-%{snapver}}
%define bdbname db4
@ -38,8 +38,21 @@ Patch2: rpm-4.8.90-fedora-specspo.patch
Patch3: rpm-4.8.0-no-man-dirs.patch
# gnupg2 comes installed by default, avoid need to drag in gnupg too
Patch4: rpm-4.8.1-use-gpg2.patch
#conditionally applied patch for arm hardware floating point
Patch5: rpm-4.9.0-armhfp.patch
#apply patch for PPC stubs
Patch6: rpm-4.9.x-debugedit-stabs-warn.patch
# Patches already in upstream
Patch100: rpm-4.9.x-fontattr.patch
Patch101: rpm-4.9.x-elfattr.patch
Patch102: rpm-4.9.x-mpsize.patch
Patch103: rpm-4.9.x-rpmdb-dsi.patch
Patch104: rpm-4.9.x-python-memleaks.patch
Patch105: rpm-4.9.x-verify-output.patch
Patch106: rpm-4.9.x-include-cond.patch
Patch107: rpm-4.9.x-exclude-warn.patch
Patch108: rpm-4.9.x-tstest-fileinfo.patch
# These are not yet upstream
Patch301: rpm-4.6.0-niagara.patch
@ -48,6 +61,8 @@ Patch302: rpm-4.7.1-geode-i686.patch
Patch303: rpm-4.9.0-debuginfo-allnames.patch
# Probably to be upstreamed in slightly different form
Patch304: rpm-4.9.1.1-ld-flags.patch
# Temporary Patch to provide support for updates
Patch400: rpm-4.9.1.2-rpmlib-filesystem-check.patch
# Partially GPL/LGPL dual-licensed and some bits with BSD
# SourceLicense: (GPLv2+ and LGPLv2+ with exceptions) and BSD
@ -209,11 +224,30 @@ packages on a system.
%patch3 -p1 -b .no-man-dirs
%patch4 -p1 -b .use-gpg2
%patch100 -p1 -b .fontattr
%patch101 -p1 -b .elfattr
%patch102 -p1 -b .mpsize
%patch103 -p1 -b .rpmdb-dsi
%patch104 -p1 -b .python-memleaks
%patch105 -p1 -b .verify-output
%patch106 -p1 -b .include-cond
%patch107 -p1 -b .exclude-warn
%patch108 -p1 -b .tstest-fileinfo
%patch301 -p1 -b .niagara
%patch302 -p1 -b .geode
%patch303 -p1 -b .debuginfo-allnames
%patch304 -p1 -b .ldflags
%patch400 -p1 -b .rpmlib-filesystem-check
# this patch cant be applied on softfp builds
%ifnarch armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l armv7l
%patch5 -p1 -b .armhfp
%endif
%patch6 -p1 -b .stubs_warn
%if %{with int_bdb}
ln -s db-%{bdbver} db
%endif
@ -426,6 +460,38 @@ exit 0
%doc COPYING doc/librpm/html/*
%changelog
* Tue Apr 03 2012 Panu Matilainen <pmatilai@redhat.com> - 4.9.1.3-1
- update to 4.1.9.3 (http://rpm.org/wiki/Releases/4.9.1.3)
- fixes CVE-2012-0060, CVE-2012-0061 and CVE-2012-0815
* Wed Mar 07 2012 Panu Matilainen <pmatilai@redhat.com> - 4.9.1.2-6
- fix memory corruption on rpmdb size estimation (#766260)
- fix couple of memleaks in python bindings (#782147)
- fix regression in verify output formatting (#797964)
- dont process spec include in false branch of if (#782970)
- only warn on missing excluded files on build (#745629)
- dont free up file info sets on test transactions
* Thu Feb 09 2012 Panu Matilainen <pmatilai@redhat.com> - 4.9.1.2-5
- adjust font detection rules for libmagic change (#757105)
- fix classification of ELF binaries with setuid/setgid bit (#758251)
- switch back to smaller BDB cache default (#752897)
* Tue Jan 24 2012 Harald Hoyer <harald@redhat.com> 4.9.1.2-4.1
- add temporary rpmlib patch to support filesystem transition
https://fedoraproject.org/wiki/Features/UsrMove
* Thu Dec 15 2011 Karsten Hopp <karsten@redhat.com> 4.9.1.2-4
- bump release
* Thu Dec 15 2011 Karsten Hopp <karsten@redhat.com> 4.9.1.2-3
- warn but dont fail the build if STABS encountered by debugedit
(#725378, Panu Matilainen)
* Tue Nov 30 2011 Dennis Gilmore <dennis@ausil.us> - 4.9.1.2-2
- conditionally apply arm patch for hardfp on all arches but arm softfp ones
* Thu Sep 29 2011 Panu Matilainen <pmatilai@redhat.com> - 4.9.1.2-1
- update to 4.9.1.2 (CVE-2011-3378)
- drop upstreamed rpmdb signal patch

View File

@ -1 +1 @@
85cc5b7adb5806b5abf5b538b088dbdc rpm-4.9.1.2.tar.bz2
e266b959de9865cce2816451e8a62e12 rpm-4.9.1.3.tar.bz2