From 6f7d71789ab19065eaf7632af26f3ca791a1a48ee138388cadbfdd9a3d88bc84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Wed, 11 Sep 2013 16:30:58 +0000 Subject: [PATCH 1/4] - fix two bugs in the rpmstrPoolRehash() function OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=290 --- rpm.changes | 5 +++++ rpm.spec | 3 ++- strpoolrehash.diff | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 strpoolrehash.diff diff --git a/rpm.changes b/rpm.changes index 00280b7..509b0a1 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Sep 11 18:28:39 CEST 2013 - mls@suse.de + +- fix two bugs in the rpmstrPoolRehash() function + ------------------------------------------------------------------- Thu Sep 5 12:01:51 UTC 2013 - schwab@linux-m68k.org diff --git a/rpm.spec b/rpm.spec index a8d9695..3823682 100644 --- a/rpm.spec +++ b/rpm.spec @@ -137,6 +137,7 @@ Patch82: noposttrans.diff Patch83: debug_gdb_scripts.diff Patch84: beedigest.diff Patch85: brp-compress-no-img.patch +Patch86: strpoolrehash.diff Patch6464: auto-config-update-aarch64.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # @@ -223,7 +224,7 @@ rm -f rpmdb/db.h %patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59 %patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69 %patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79 -%patch -P 80 -P 81 -P 82 -P 83 -P 84 -P 85 +%patch -P 80 -P 81 -P 82 -P 83 -P 84 -P 85 -P 86 %ifarch aarch64 %patch6464 %endif diff --git a/strpoolrehash.diff b/strpoolrehash.diff new file mode 100644 index 0000000..27d8678 --- /dev/null +++ b/strpoolrehash.diff @@ -0,0 +1,47 @@ +--- rpmio/rpmstrpool.c.orig 2013-09-11 15:33:48.371571600 +0000 ++++ rpmio/rpmstrpool.c 2013-09-11 16:20:56.106566595 +0000 +@@ -219,8 +219,17 @@ static void rpmstrPoolRehash(rpmstrPool + pool->hash = poolHashFree(pool->hash); + + pool->hash = poolHashCreate(sizehint); +- for (int i = 1; i < pool->offs_size; i++) +- poolHashAddEntry(pool, rpmstrPoolStr(pool, i), i); ++ for (int i = 1; i <= pool->offs_size; i++) { ++ /* this is a little bit tricky because we have to skip the dummy ++ * entries that are at the end of each chunk */ ++ const char * str = rpmstrPoolStr(pool, i); ++ if (str[0] == 0 && i < pool->offs_size) { ++ /* looks like a dummy entry, check if next str is in a different chunk */ ++ if (rpmstrPoolStr(pool, i + 1) != str + 1) ++ continue; ++ } ++ poolHashAddEntry(pool, str, i); ++ } + } + + rpmstrPool rpmstrPoolCreate(void) +@@ -308,7 +317,8 @@ static rpmsid rpmstrPoolPut(rpmstrPool p + } + + chunk_used = pool->offs[pool->offs_size] - pool->chunks[pool->chunks_size]; +- if (ssize + 1 > pool->chunk_allocated - chunk_used) { ++ /* +2: extra trailing zero + extra byte */ ++ if (ssize + 2 > pool->chunk_allocated - chunk_used) { + /* check size of ->chunks */ + pool->chunks_size += 1; + if (pool->chunks_size >= pool->chunks_allocated) { +@@ -318,11 +328,12 @@ static rpmsid rpmstrPoolPut(rpmstrPool p + } + + /* Check if string is bigger than chunks */ +- if (ssize > pool->chunk_allocated) { +- pool->chunk_allocated = 2 * ssize; ++ if (ssize + 2 > pool->chunk_allocated) { ++ pool->chunk_allocated = 2 * ssize + 2; + } + + /* Dummy entry for end of last string*/ ++ pool->offs[pool->offs_size][0] = 0; + pool->offs_size += 1; + + pool->offs[pool->offs_size] = xcalloc(1, pool->chunk_allocated); From 785c0a0cdfe45c92608a61a092733df9cecb2e66f5f679120436cb05e67fd330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Schr=C3=B6der?= Date: Wed, 11 Sep 2013 17:14:54 +0000 Subject: [PATCH 2/4] more fixes OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=291 --- ignore_poolstr_dummy_entries.diff | 11 +++++++++++ rpm.spec | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ignore_poolstr_dummy_entries.diff diff --git a/ignore_poolstr_dummy_entries.diff b/ignore_poolstr_dummy_entries.diff new file mode 100644 index 0000000..0a90ab5 --- /dev/null +++ b/ignore_poolstr_dummy_entries.diff @@ -0,0 +1,11 @@ +--- build/rpmfc.c.orig 2013-09-11 17:13:39.165560997 +0000 ++++ build/rpmfc.c 2013-09-11 17:13:52.171560974 +0000 +@@ -848,6 +848,8 @@ rpmRC rpmfcApply(rpmfc fc) + previx = -1; + for (rpmsid id = 1; id <= nddict; id++) { + s = rpmstrPoolStr(fc->ddict, id); ++ if (!s || !*s) ++ continue; + + /* Parse out (file#,deptype,N,EVR,Flags) */ + ix = strtol(s, &se, 10); diff --git a/rpm.spec b/rpm.spec index 3823682..6316ce8 100644 --- a/rpm.spec +++ b/rpm.spec @@ -138,6 +138,7 @@ Patch83: debug_gdb_scripts.diff Patch84: beedigest.diff Patch85: brp-compress-no-img.patch Patch86: strpoolrehash.diff +Patch87: ignore_poolstr_dummy_entries.diff Patch6464: auto-config-update-aarch64.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # @@ -224,7 +225,7 @@ rm -f rpmdb/db.h %patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59 %patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69 %patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79 -%patch -P 80 -P 81 -P 82 -P 83 -P 84 -P 85 -P 86 +%patch -P 80 -P 81 -P 82 -P 83 -P 84 -P 85 -P 86 -P 87 %ifarch aarch64 %patch6464 %endif From d79e9fd06b735f663635e20dcd2516b0956384b38ac0ac488e366c6de416ea4e Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 24 Sep 2013 12:26:06 +0000 Subject: [PATCH 3/4] Accepting request 200349 from home:bernhard-voelker:branches:Base:System - replace obsoleted "find -perm +NNN" syntax [bnc#842004] to "-perm /NNN" in debugsource-package.diff and finddebuginfo.diff. OBS-URL: https://build.opensuse.org/request/show/200349 OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=292 --- debugsource-package.diff | 4 ++-- finddebuginfo.diff | 2 +- rpm.changes | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/debugsource-package.diff b/debugsource-package.diff index 11eae89..5daf8e5 100644 --- a/debugsource-package.diff +++ b/debugsource-package.diff @@ -31,9 +31,9 @@ build the binary. The patches moves them into a separate package -debugsource. $strict || strict_error=WARNING -# Strip ELF binaries --find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z | +-find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z | +# Strip ELF binaries (and no static libraries) -+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 | sort -z | ++find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 | sort -z | xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' | while read nlinks inum f; do case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in diff --git a/finddebuginfo.diff b/finddebuginfo.diff index 11be196..1a6aca0 100644 --- a/finddebuginfo.diff +++ b/finddebuginfo.diff @@ -39,7 +39,7 @@ - -print | -file -N -f - | sed -n -e 's/^\(.*\):[ ]*.*ELF.*, not stripped/\1/p' | -xargs --no-run-if-empty stat -c '%h %D_%i %n' | -+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z | ++find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm /111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z | +xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' | while read nlinks inum f; do + case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in diff --git a/rpm.changes b/rpm.changes index 509b0a1..7e5c869 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Sep 24 10:36:15 UTC 2013 - mail@bernhard-voelker.de + +- replace obsoleted "find -perm +NNN" syntax [bnc#842004] + to "-perm /NNN" in debugsource-package.diff and + finddebuginfo.diff. + ------------------------------------------------------------------- Wed Sep 11 18:28:39 CEST 2013 - mls@suse.de From 2c5ee86d6c0b18ae7db026884d715ac932b0ffaa8c32d8988a4b9f3324d41872 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 26 Sep 2013 07:00:31 +0000 Subject: [PATCH 4/4] - fix two bugs in the rpmstrPoolRehash() function: adding strpoolrehash.diff and ignore_poolstr_dummy_entries.diff OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=293 --- rpm.changes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rpm.changes b/rpm.changes index 7e5c869..aaf2e8f 100644 --- a/rpm.changes +++ b/rpm.changes @@ -8,7 +8,8 @@ Tue Sep 24 10:36:15 UTC 2013 - mail@bernhard-voelker.de ------------------------------------------------------------------- Wed Sep 11 18:28:39 CEST 2013 - mls@suse.de -- fix two bugs in the rpmstrPoolRehash() function +- fix two bugs in the rpmstrPoolRehash() function: + adding strpoolrehash.diff and ignore_poolstr_dummy_entries.diff ------------------------------------------------------------------- Thu Sep 5 12:01:51 UTC 2013 - schwab@linux-m68k.org