platform/upstream/rpm.git
11 years agoAdd missing <errno.h> include rpm-4.10.2-release
Panu Matilainen [Mon, 26 Nov 2012 11:34:06 +0000 (13:34 +0200)]
Add missing <errno.h> include

- Should've been in commit cbd6ef58bbc122e6adf2138679915bd3845d6756,
  this breaks build when selinux-support is not compiled in
(cherry picked from commit ebba1c7b58ba089bb9e1ded147c789d9ca067b6c)

11 years agoPreparing for 4.10.2 rpm-4.10.2
Panu Matilainen [Fri, 7 Dec 2012 12:44:40 +0000 (14:44 +0200)]
Preparing for 4.10.2

- Bump package version and library revisions, update translations

11 years agoEnsure correct return code on malformed signature in packages
Panu Matilainen [Fri, 7 Dec 2012 11:54:23 +0000 (13:54 +0200)]
Ensure correct return code on malformed signature in packages

- rpmpkgRead() starts with assumed failure, but there are a number
  of places assigning the return code, and by the time we get
  to the parsePGPSig() calls its likely to be RPMRC_OK, so the
  jumps to exit result in "all is well" return code on a signature
  we couldn't even parse. Oops.
- Set the failure status explicitly to fix this fairly nasty regression
  introduced in commit e8bc3ff5d780f4ee6656c24464402723e5fb04f4, ie
  rpm >= 4.10.
(cherry picked from commit 96a616c6aed4c516789a154af188f005caf23f14)

11 years agoHandle allocation failure in NSS DSA signature initialization
Panu Matilainen [Tue, 4 Dec 2012 12:06:42 +0000 (14:06 +0200)]
Handle allocation failure in NSS DSA signature initialization
(cherry picked from commit 2d39f13064f6e6ff1a1633b708e7ba5622a7e8eb)

11 years agoUnbreak --setperms (RhBug:881835)
Panu Matilainen [Fri, 30 Nov 2012 06:15:24 +0000 (08:15 +0200)]
Unbreak --setperms (RhBug:881835)

- Fixes a regression introduced in rpm >= 4.10 caused by query format
  simplification (loss of zero padding support), in commit
  1f1e5e88a1f6c60cf2d11014d809000e97a63aad.
- 'chmod' command doesn't need zero padding, just remove the formatting.
  In fact we shouldn't be passing the entire mode to it but just the
  permission bits, but fortunately chmod isn't too picky here.
(cherry picked from commit 4c90c79e3f3c178189ad3bd89dfd87cd3a2290ab)

11 years agoRemove extra ',' in NSS configure checks, whoops
Panu Matilainen [Thu, 29 Nov 2012 10:31:52 +0000 (12:31 +0200)]
Remove extra ',' in NSS configure checks, whoops
(cherry picked from commit e1c67173d38016a88989f5b09e0934f90094fe85)

11 years agoUse NSS-defined constants for DSA q-bits and signature length too
Panu Matilainen [Thu, 29 Nov 2012 09:05:04 +0000 (11:05 +0200)]
Use NSS-defined constants for DSA q-bits and signature length too

- No functional changes here (either), but using the proper constants
  simply makes things that little bit clearer.
(cherry picked from commit 604da18bc267f89568081c1ab163c7fc45207220)

11 years agoAvoid deprecation warnings from NSS >= 3.14
Panu Matilainen [Thu, 29 Nov 2012 08:43:24 +0000 (10:43 +0200)]
Avoid deprecation warnings from NSS >= 3.14

- NSS >= 3.14 introduces support for DSA2 and marks DSA_SUBPRIME_LEN
  as deprecated. Use explicit DSA1_SUBPRIME_LEN (we only support DSA1
  for now) instead where available, add compatibility define for
  older versions.
- Also directly include <blapit.h> where its defined - blabit.h gets
  included via cryptohi.h but being explicit about it avoids having
  to redefine it again "just in case".
(cherry picked from commit 73be0fc7d9faab9f1120e2979f2ca1feed522195)

11 years agoAvoid locale issues in rpm2cpio.sh (RhBug:878363)
Panu Matilainen [Thu, 22 Nov 2012 10:22:06 +0000 (12:22 +0200)]
Avoid locale issues in rpm2cpio.sh (RhBug:878363)

- In gawk >= 4.0.x printf() "adjusts" things according to current locale,
  but we need the data as it is. Forcing C locale prevents gawk from
  getting funny ideas about character conversions...
(cherry picked from commit c0e95f1cedefd6d7522ef2cf7a2ada7c83821596)

11 years agoAdd --undefine cli switch for undefining macros (related to RhBug:876308)
Panu Matilainen [Fri, 16 Nov 2012 11:21:15 +0000 (13:21 +0200)]
Add --undefine cli switch for undefining macros (related to RhBug:876308)
(cherry picked from commit 644f080a4868208bf61f28103b7b676c094129a0)

11 years agoDocument --define in rpmbuild manual as well (RhBug:665536)
Panu Matilainen [Tue, 6 Nov 2012 11:29:11 +0000 (13:29 +0200)]
Document --define in rpmbuild manual as well (RhBug:665536)
(cherry picked from commit 3cc768e72cbd5a40cc7745c71cd8fac1164f80ae)

11 years agoWork around Fedora-specific patch to libselinux causing warnings
Panu Matilainen [Mon, 5 Nov 2012 14:00:39 +0000 (16:00 +0200)]
Work around Fedora-specific patch to libselinux causing warnings

- In recent Fedora, struct selinux_opt value member is changed to an
  anonymous union of char * and char **. Initialize the members by name
  to avoid warnings in both (patched and unpatched) cases.
(cherry picked from commit 249128b3f85cb1544df74c4953a65507c2aea9f6)

11 years agoFix strncat() boundaries in Fdopen()
Dominique Leuenberger [Mon, 5 Nov 2012 13:45:29 +0000 (15:45 +0200)]
Fix strncat() boundaries in Fdopen()

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 34c4565d8ce656de7ccad9c098757e367916d66f)

11 years agoUpdate contact address in COPYING (RhBug:742362)
Panu Matilainen [Mon, 5 Nov 2012 13:08:28 +0000 (15:08 +0200)]
Update contact address in COPYING (RhBug:742362)

- marc and ewt haven't been valid email addresses in the last 10+
  years, cough...
(cherry picked from commit 6359697b256dbf402a0437fe8d99b38800579eaa)

11 years agoUse private NSS context if NSS supports it (RhBug:871485)
Panu Matilainen [Wed, 31 Oct 2012 07:43:38 +0000 (09:43 +0200)]
Use private NSS context if NSS supports it (RhBug:871485)

- Older NSS versions operate on global context, which can cause
  all sorts of trouble when an API user tries to use NSS for their
  own purposes: eg they might want to use NSS databases which is not
  possible once we've initialized NSS with NSS_NoDB_Init(). Further
  background on the subject at https://wiki.mozilla.org/NSS_Library_Init
- Use private private NSS context when possible (NSS >= 3.12.5) to
  avoid such clashes, but keep support for older versions for now.
(cherry picked from commit 5ecfdcea4e80e58f133ffddd69130ee8df28b2ac)

11 years agoHandle EINTR in Fread() and Fwrite()
Panu Matilainen [Tue, 30 Oct 2012 10:38:20 +0000 (12:38 +0200)]
Handle EINTR in Fread() and Fwrite()

- Not all systems automatically restart signal-interrupted operations,
  handle this centrally since its so easy to do. Also related to
  RhBug:580974.
(cherry picked from commit eb23d21b3da0789c19a2e97306745be443567d41)

11 years agoHandle partial reads and errors in package IO (RhBug:802839, RhBug:580974)
Panu Matilainen [Tue, 30 Oct 2012 09:36:56 +0000 (11:36 +0200)]
Handle partial reads and errors in package IO (RhBug:802839, RhBug:580974)

- There are no guarantees Fread() will return all of the requested size:
  it can return partial data eg on signals and pipe descriptors. Introduce
  a helper function to handle this centrally for all package read IO,
  effectively reintroducing timedRead() but without the caveats:
  timedRead() did not work on compressed streams, did not handle
  eg EINTR correctly and while really being an internal helper,
  was exported in the API.
(cherry picked from commit cbd6ef58bbc122e6adf2138679915bd3845d6756)

11 years agoFix missing error on --import on bogus key file (RhBug:869667)
Panu Matilainen [Tue, 30 Oct 2012 07:29:46 +0000 (09:29 +0200)]
Fix missing error on --import on bogus key file (RhBug:869667)

- When the "BEGIN PGP" marker is not found at all, we would silently
  exit with success when trying to import utter garbage, such as
  rpmkeys --import /bin/bash (not that I consider bash as gargabe ;)
(cherry picked from commit 0b9c93ed18a11818a2f3645431a338bdc3f1fc81)

11 years agoFix noarch __isa_* macro filter in installplatform (RhBug:865436)
Panu Matilainen [Thu, 11 Oct 2012 14:57:10 +0000 (17:57 +0300)]
Fix noarch __isa_* macro filter in installplatform (RhBug:865436)

- The filter wasn't doing what it was supposed to due to extra single
  quotes getting inserted, causing "rpmbuild --target noarch foo.spec"
  to whine about empty macro bodies. This is a regression introduced
  in rpm 4.10, commit 07ec480c180e4005a629242b8f9f8ab640e3e950 to be
  precise.
(cherry picked from commit 90dd51743200055f30d9e0e0337173118b4ae756)

11 years agoAdd rpm --setperms and rpm --setugids to the man page
Florian Festi [Wed, 10 Oct 2012 12:59:32 +0000 (14:59 +0200)]
Add rpm --setperms and rpm --setugids to the man page
(cherry picked from commit 5a674fba65b0988118401f3cccd12ee2bfe904e0)

11 years agoFilter out skipped files on hardlink checking (RhBug:864622)
Panu Matilainen [Wed, 10 Oct 2012 07:37:34 +0000 (10:37 +0300)]
Filter out skipped files on hardlink checking (RhBug:864622)

- Legitimately skipped files (links) must not cause install-errors.
  This has always been broken, but the errors were completely ignored
  on install prior to rpm 4.10.
- Backported from commit eeea54c76b130da3769ae10f7db2c2fcfb5c57be

11 years agoPreparing for 4.10.1 rpm-4.10.1 upstream/4.10.1
Panu Matilainen [Wed, 3 Oct 2012 08:51:16 +0000 (11:51 +0300)]
Preparing for 4.10.1

- Bump package version and library revisions, update translations

11 years agoPermit key imports even if signature checking is disabled (RhBug:856225)
Panu Matilainen [Mon, 17 Sep 2012 07:48:05 +0000 (10:48 +0300)]
Permit key imports even if signature checking is disabled (RhBug:856225)

- Since commit 290fcbbe6b3ca2fb1d5e4a7269a32a94f8a1563a, key imports
  on transaction sets where signature checking is disabled would fail
  due to keyring not getting loaded at all. A regression of sorts,
  in other words. As a minimal fix, temporarily enable sigcheck vsflags
  during keyring loading.
(cherry picked from commit 9209e6cd78a1e6814f3038734cdd300b97ddcf1b)

11 years agoFix memleak regresssion in rpmfiDecideFateIndex()
Panu Matilainen [Wed, 3 Oct 2012 07:59:57 +0000 (10:59 +0300)]
Fix memleak regresssion in rpmfiDecideFateIndex()

- Similar to commit 80ee39da35544253cab12abd54af8754335ac945: this
  started leaking at commit 3f996a588a56141df146c33583a13c0542323977
  as rpmfiFNIndex() returns malloced memory. Refactor the lucky 13
  return points into one, allowing cleanup at exit.
- Backported from commit 273a025c504774b5dfec2429ca0d5e4f8c73a891

11 years agoFix a massive memleak from rpmfiConfigConflictIndex() and optimize it
Panu Matilainen [Wed, 22 Aug 2012 09:40:00 +0000 (12:40 +0300)]
Fix a massive memleak from rpmfiConfigConflictIndex() and optimize it

- rpmfiFNIndex() returns a malloced string since commit
  11116a67864c119e420297984bd9ec4b83fdadd7 but this wasn't taken into
  account in commit 3f996a588a56141df146c33583a13c0542323977, causing
  a massive memory leak on transaction preparations.
- Optimize the entry by avoiding rpmfiFNIndex() and lstat() until
  really necessary, and use a central exit point beyond that so
  we can free fn. Besides fixing the memleak, this gives a small
  but measurable performance improvement on this rather busy path.
- Backported from commit 80ee39da35544253cab12abd54af8754335ac945

11 years agoAdd a test-case for the shared file timestamp behavior
Panu Matilainen [Fri, 17 Aug 2012 11:14:46 +0000 (14:14 +0300)]
Add a test-case for the shared file timestamp behavior

- Prior to commit f7f5f88f9f3d6587e747b034ccb64a3f00ff4e1e, this
  would've failed: removing the last package to be installed would
  cause timestamp failure on all others. The order is arbitrary in
  this testcase but it matters in real-world situations such as
  secondary arch packages.
(cherry picked from commit bf3d65e7951aa9d98ef86db15982643a9cad79ce)

11 years agoOnly create the first instance of a file shared between packages
Panu Matilainen [Fri, 17 Aug 2012 11:07:05 +0000 (14:07 +0300)]
Only create the first instance of a file shared between packages

- When packages share an identical file, we only need to create the
  first one we encounter and skip it for the rest (reverse already
  happens, and must happen, on erase). This has the benefit of
  getting the timestamp to match the first file, which often is
  also the last one to get removed. Also when lots of shared files
  are involved (such as in multilib installations), this can give
  several percents worth of speed gain as we dont unnecessarily rewrite
  the same contents over and over.
(cherry picked from commit f7f5f88f9f3d6587e747b034ccb64a3f00ff4e1e)

11 years agoRevert "Always return NULL from fdFree()"
Panu Matilainen [Fri, 17 Aug 2012 08:30:43 +0000 (11:30 +0300)]
Revert "Always return NULL from fdFree()"

- This reverts commit 4c1f7e335de1724661ce63c53186d161ab71a63f:
  various things inside and outside of rpm actually do still depend
  on the old behavior, and leak file descriptors otherwise.
  As an easy backportable band-aid, revert back to the previous
  behavior, to which various callers are tuned to fix the regression
  introduced in rpm 4.10.0. The real fix would be something more like
  "eliminate fdFree() and make Fclose() honor refcounts".
(cherry picked from commit 429b933b42d1821f6f0a2a41ae13c504ea6d0657)

11 years agoFix bogus "unclosed %if" error when %include is used in conditionals
Panu Matilainen [Wed, 8 Aug 2012 06:43:42 +0000 (09:43 +0300)]
Fix bogus "unclosed %if" error when %include is used in conditionals

- All rpm versions log a bogus "unclosed %if" error when %include
  is used inside %if-%endif (and rpm >= 4.10 actually aborts the
  parse): the check for unclosed if occurs before checking whether
  there's more to come.
- Move the error check into readLine() EOF path along with the other
  similar check to fix, and to consolidate the error handling to
  a single spot.
- Backported from commit e06177ee657fbb1c32e1f651c8ae4da73e87c65b

11 years agoAdd test for file verification from originating package
Panu Matilainen [Tue, 7 Aug 2012 09:52:29 +0000 (12:52 +0300)]
Add test for file verification from originating package
(cherry picked from commit 4e221afaa20015de97c7ebb44769772502eb9999)

11 years agoVerify files from non-installed packages again (RhBug:826589)
Panu Matilainen [Tue, 7 Aug 2012 09:28:56 +0000 (12:28 +0300)]
Verify files from non-installed packages again (RhBug:826589)

- Verifying files against the originating, non-installed package can
  be useful sometimes, eg if rpmdb is broken or cannot be trusted.
  Of course such verification will give false positives on files that
  were intentionally skipped during installation (nodocs, wrong color,
  netshared...), that can't be helped.
- This restores the former behavior that was erroneously changed
  in commit adbd484372cb38aca5aca3c6dba3b2ca9cae93d1 while "fixing"
  an unhandled enumeration in the switch. Doh.
(cherry picked from commit 227654f30c099bfb1e631fd200f10576b3f58def)

11 years agoAccept em64t architecture as an alias for x86_64 (RhBug:800489)
Panu Matilainen [Tue, 7 Aug 2012 08:29:03 +0000 (11:29 +0300)]
Accept em64t architecture as an alias for x86_64 (RhBug:800489)

- Some vendors insist on calling their x86_64 packages "em64t" instead
  of the more standard x86_64. Minimally support this naming convention
  as those packages aren't going away anytime soon - be liberal in
  what you accept and all, sigh.
(cherry picked from commit d6add031f1e63cc228cc5002df06a52c76479560)

11 years agoAdd tests for invalid --relocate detection and --badreloc functionality
Panu Matilainen [Tue, 7 Aug 2012 07:21:36 +0000 (10:21 +0300)]
Add tests for invalid --relocate detection and --badreloc functionality
(cherry picked from commit 72621fcf32a6fa4fdda16f6b6729e7c6fe0943ea)

11 years agoFix RPMPROB_FILTER_FORCERELOCATE aka --badreloc (RhBug:828784)
Panu Matilainen [Tue, 7 Aug 2012 06:52:15 +0000 (09:52 +0300)]
Fix RPMPROB_FILTER_FORCERELOCATE aka --badreloc (RhBug:828784)

- As noted (but since then blissfully forgotten) in the commit message,
  commit e696b409fe836bf39cbf639bac4321d658d0952d broke --badreloc
  so its been broken since rpm >= 4.9.x :-/
- Transaction problem filter is only available during rpmtsRun() so
  we have no clue whether bad relocations should be filtered or not
  during rpmte creation. Instead of creating the problems at rpmteNew()
  time, remember any bad relocations that were found and check +
  create the actual problems (unless filtered) along with other
  problems during rpmtsRun().
- Passing an "allow bad relocations" flag to rpmtsAddInstallElement()
  would be a saner option but this is a back-portable way of handling it.
(cherry picked from commit 4fbb58c7e6ee7d1bb565b27e4f81dcf2fee93995)

11 years agoHonor RPMSENSE_MISSINGOK flag in dependency checking
Panu Matilainen [Fri, 3 Aug 2012 08:59:12 +0000 (11:59 +0300)]
Honor RPMSENSE_MISSINGOK flag in dependency checking

- For now there's no way to set this flag from packages so it doesn't
  actually do anything, but it doesn't hurt anything either, allows
  Suse & friends to drop one patch (greetings Michael :) and there
  are might be some things we could use this for internally.
(cherry picked from commit ecd9aceb565be9b672091cbcb5b2db408dcb1d91)

11 years agoDont silence patch by default (RhBug:678000, RhBug:773503)
Panu Matilainen [Thu, 2 Aug 2012 15:16:09 +0000 (18:16 +0300)]
Dont silence patch by default (RhBug:678000, RhBug:773503)

- Unfortunately patch'es idea of "interesting" output is not ideal for
  our purposes: "patching foo.c" is of little value, but hunks with
  offsets and fuzz can be important and there's no switch to patch
  to get exactly what we want. So let it be chatty... build logs are,
  anyway.
(cherry picked from commit 933a3e32dd94c5d54d10c24c55394488824de1f0)

11 years agoAdd --noclean and --nocheck options to rpmbuild
Panu Matilainen [Thu, 2 Aug 2012 08:49:48 +0000 (11:49 +0300)]
Add --noclean and --nocheck options to rpmbuild

- Ability to skip %clean build stage was requested as RhBug:756531,
  --nocheck seems otherwise useful to have as %check can take a lot of
  time, time you might not want to spend for a trivial spec change or such.
(cherry picked from commit 12f9b3f9e6b35e5ad2f9edd4e112d6495756a562)

11 years agoFix memleak in changelog parsing on error paths
Panu Matilainen [Wed, 1 Aug 2012 16:17:09 +0000 (19:17 +0300)]
Fix memleak in changelog parsing on error paths

- All the early returns would leak memory from the argvJoin(),
  assume failure and force all exits through a single path where
  we can clean up.
(cherry picked from commit 395be24637b4ba555598df18f8feded097bbd03f)

11 years agoPermit non-existent %ghost directories to be packaged (RhBug:839656)
Panu Matilainen [Wed, 1 Aug 2012 13:00:16 +0000 (16:00 +0300)]
Permit non-existent %ghost directories to be packaged (RhBug:839656)

- Directories can be explicitly specified via either %dir or trailing
  slash in the %files manifest, take this into account for %ghosts that
  dont exist in the buildroot. Otherwise we still assume regular file.
- Dont require explicit %attr() for missing %ghosts, let them fall
  back to %defattr() instead. If %defattr() doesn't specify a mode
  the file will be seen without any permissions at all, but that's
  not strictly an error (and same can happen with %dev() already)
- Backported from commit d6775a746bbaf8ddc8a91c9fae68ae91af1cc570

11 years agoDont bother asking libmagic about directories
Panu Matilainen [Wed, 1 Aug 2012 09:06:45 +0000 (12:06 +0300)]
Dont bother asking libmagic about directories

- There's no (relevant) additional information to be gained from passing
  directories to libmagic and we already have this info available in the
  file mode. This permits nice and easy handling of %ghost directories
  (related to RhBug:839656)
(cherry picked from commit 24ad8291bbcdb523f1aa58d75e29f9ffeb484b52)

11 years agoReport starting line for unclosed %if in specs
Panu Matilainen [Tue, 31 Jul 2012 13:16:15 +0000 (16:16 +0300)]
Report starting line for unclosed %if in specs
(cherry picked from commit 9c26bd05eaa5d6a180d33432585e9fbce0004a41)

11 years agoFix (well, loosen up) the valgrind suppression rules
Panu Matilainen [Mon, 30 Jul 2012 14:22:55 +0000 (17:22 +0300)]
Fix (well, loosen up) the valgrind suppression rules

- The previous rules far too specific to glibc + gcc with certain
  optimization levels, eg relying on parse_auxv() getting inlined
  and when it does not, the suppression rules would no longer match.
(cherry picked from commit 66ed9fc6160fb455a6c5760f426962e1288c19f8)

11 years agoAlways print out package dependencies on build
Panu Matilainen [Thu, 12 Jul 2012 11:51:12 +0000 (14:51 +0300)]
Always print out package dependencies on build

- Previously packages which had no files or for which automatic
  dependency generation was partially or fully disabled didn't get
  any of their dependencies printed out at build-time. This doesn't
  affect the actual recorded dependencies, only the "debugging"
  output during package builds.
(cherry picked from commit 2e95618c0e85ea094a98ddb6ab110747bc0e00e4)

11 years agoReport config and missinok flags in deptype format extension too
Panu Matilainen [Wed, 11 Jul 2012 12:10:08 +0000 (15:10 +0300)]
Report config and missinok flags in deptype format extension too
(cherry picked from commit 928386a317aad2be6ce1a76b4dbee5a948a6184a)

11 years agoAccept "owner" as an alias to "user" %verify attribute (RhBug:838657)
Panu Matilainen [Tue, 10 Jul 2012 09:46:22 +0000 (12:46 +0300)]
Accept "owner" as an alias to "user" %verify attribute (RhBug:838657)

- Both Maximum RPM and the newer RPM Guide incorrectly list "owner"
  as a valid %verify() attribute, whereas rpm has used "user"
  for as long as the code has been present (since 1996). Since
  adding the alias is so trivial, and certainly easier than changing
  published books... meh.
- Backported from commit d1dcc53dfb7658b46c108a4cd011439c2a6b45ea

11 years agoRecognize relative paths as such in --whatprovides query
Panu Matilainen [Tue, 3 Jul 2012 05:51:09 +0000 (08:51 +0300)]
Recognize relative paths as such in --whatprovides query
(cherry picked from commit 32a4e283a6a0fa572ac6f41d548079df9aa7fd40)

11 years agoDont use mmap() for anything, axe the code instead
Panu Matilainen [Mon, 2 Jul 2012 11:30:24 +0000 (14:30 +0300)]
Dont use mmap() for anything, axe the code instead

- Commit 4cb02aa928d3e41f636d0e01356c7a3cb51018ee asked to see
  what breaks when mmap() is used, now we know: large package support
  broke when enabling it. Could be fixed of course by eg adding
  a size cap to the fsm part as well, but just doesn't seem worth it:
  I fail to measure any meaningful performance improvement from mmap
  usage in either case, and added complexity for what is close to
  zero benefit just doesn't make sense... and various sources in fact
  note the rpm usage (read through the entire file sequentially) as one
  of the cases where mmap() is NOT beneficial due to mmap() high
  setup + teardown cost + page fault speed (or lack of thereof).
- Backported from commits bf3a14a86682e4bf341eed4d6d7050ef57b1ccc2 and
  eefcb12b9c12e29ee83bbb193842af84a0142bb6

11 years agoArch macro for all supported PowerPC 64 processors (RhBug:818320)
Phil Knirsch [Thu, 28 Jun 2012 07:21:04 +0000 (10:21 +0300)]
Arch macro for all supported PowerPC 64 processors (RhBug:818320)
(cherry picked from commit 105f91fc9a0afd9f8d29491c909833bdf2228f8a)

11 years agoPlain 32bit ppc cannot be a ppc64p7
Phil Knirsch [Thu, 28 Jun 2012 07:15:59 +0000 (10:15 +0300)]
Plain 32bit ppc cannot be a ppc64p7

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit a7248ac1c986bcf9f352ae22faa2ad22784e7e3e)

11 years agoClarify/correct tag usage in rpmdbProvides()
Panu Matilainen [Wed, 27 Jun 2012 08:10:57 +0000 (11:10 +0300)]
Clarify/correct tag usage in rpmdbProvides()

- Refer to RPMTAG_* for rpmds tags, not RPMDBI_*. The values for these
  are the same, only the "intended use" differs (RPMDBI refers to
  rpmdb indexes) so this doesn't change anything in practise.
(cherry picked from commit 3ffaef5afcb7de4e3d3c10e4cf6a9e0d6d3f1df7)

11 years agoFix obsoletes-thinko in rpmdbProvides()
Panu Matilainen [Wed, 27 Jun 2012 08:08:25 +0000 (11:08 +0300)]
Fix obsoletes-thinko in rpmdbProvides()

- dbtag cannot possibly be on obsoletes here, we need to look at deptag
  instead. This thinko in commit 5f1ec21518078e599b2499cf1ff852837ec33df7
  renders that whole commit useless. Doh.
(cherry picked from commit 2cb102f35e995d4e1a6f4a14b09e30ecfe6c2513)

11 years agoAdd valgrind suppression file
Panu Matilainen [Tue, 19 Jun 2012 07:30:08 +0000 (10:30 +0300)]
Add valgrind suppression file

- valgrind is not happy about us now processing /proc/self/auxv on Linux,
  this can be used to suppress the false positives when running
  rpm under valgrind. At least until a better solution is found or
  valgrind is taught to treat /proc/self/auxv specially (see
  https://bugs.kde.org/show_bug.cgi?id=253519)
(cherry picked from commit da01eb98c131020cb3de5c208d2e76a06ae67049)

11 years agoFix spec parsing memleak from source header on buildarch recursion
Panu Matilainen [Mon, 28 May 2012 09:02:47 +0000 (12:02 +0300)]
Fix spec parsing memleak from source header on buildarch recursion
(cherry picked from commit 06cd93832d5caab88b7879b0aaa98d12d88ac5db)

12 years agoPreparing for 4.10.0 final rpm-4.10.0
Panu Matilainen [Tue, 22 May 2012 10:56:56 +0000 (13:56 +0300)]
Preparing for 4.10.0 final

12 years agoAdd support for 7zip compressed tarballs
Christophe Fergeau [Thu, 10 May 2012 21:27:56 +0000 (23:27 +0200)]
Add support for 7zip compressed tarballs

Teach %prep and %uncompress how to handle 7zip tarballs, with
the mingw toolchain landing in fedora, this may be useful when
crossbuilding Windows sources compressed using 7zip (CxImage is
one such project).
(cherry picked from commit 185596818f763af1249f19161f38134ee93092d2)

12 years agoFix off-by-ones in mbAppend() and mbAppendStr()
Panu Matilainen [Thu, 10 May 2012 08:28:39 +0000 (11:28 +0300)]
Fix off-by-ones in mbAppend() and mbAppendStr()

- Oops, remember to reserve space for the trailing \0 when appending.
  mb->nb holds the number of actual characters left in the buffer,
  not the terminator. Fixes a regression introduced in rpm 4.9.x
  dynamic macro realloction work (RhBug:431009 reprise)
(cherry picked from commit 6101cac6b3357fab763636da53d52ea9810cb54f)

12 years agoSimplify mono file magic regex
Panu Matilainen [Mon, 7 May 2012 12:29:14 +0000 (15:29 +0300)]
Simplify mono file magic regex

- Begin/end restrictions with wildcards on both ends dont make much
  sense, just match on the plain (sub)string
(cherry picked from commit 416fc709ab1a711ae441271154f72b1b5d9401cb)

12 years agoRelax python file magic regex somewhat
Panu Matilainen [Mon, 7 May 2012 12:17:45 +0000 (15:17 +0300)]
Relax python file magic regex somewhat

- libmagic sometimes adds trailing descriptions about encodings, line
  terminators and whatnot, we dont want to care about those (RhBug:796218)
- not all python-related strings start with [pP]ython either, sometimes
  libmagic says "a python script" or "a /usr/bin/python script" and
  whatnot, so loose the start-of-line restriction as well
(cherry picked from commit f2f4bfe9a57ee3da4a63ae4b93d0cca444d9389e)

12 years agoTweak font magic regex a bit (yet again)
Panu Matilainen [Mon, 7 May 2012 11:51:32 +0000 (14:51 +0300)]
Tweak font magic regex a bit (yet again)

- Lose the pointless begin/end restrictions, take the optional
  space into account for both optional parts (one of the later issues
  in RhBug:757105)
(cherry picked from commit 49e398278fd75996909e99c0cec7667b0f8d55be)

12 years agoSmall patch to reverse hardlink ordering
Michael Schroeder [Thu, 3 May 2012 09:49:56 +0000 (11:49 +0200)]
Small patch to reverse hardlink ordering

Hi Panu et al,

Here's a small patch that changes the ordering used for putting
hardlinked files into the cpio archive back to lexicographical.

You might wonder what this is about. Well, old rpm-3 (and
also old versions of rpm-4, I think) already used lexicographical
ordering for files and hardlinks. When deltarpm was created,
it made use of this fact when "compressing" the file order
of the cpio archive into the so-called "sequence". Deltarpm
can deal with "out of order" files, but in that case it needs
to reset the compression, which leads to really long sequence
strings.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit bb335292d30893eb88bdf47f166e254fa7abe37e)

12 years agoFall back to private db environment on system level EINVAL
Panu Matilainen [Thu, 3 May 2012 13:15:59 +0000 (16:15 +0300)]
Fall back to private db environment on system level EINVAL

- BDB wants to use mmap() for its environment by default, but not
  all (file)systems support this, as pointed out by Daniel Drak.
  However env->open() can return EINVAL for a number of reasons,
  require all the fallback reasons to be system level errors to
  differentiate from "logical" errors such as incompatible flags
  to (possibly pre-existing) db environment, in which case we better
  just error out.
(cherry picked from commit 58c5eb28d5f267313294486c6f8a7a6c84984d86)

12 years agoEliminate unused selinux file context path macros
Panu Matilainen [Wed, 2 May 2012 12:17:01 +0000 (15:17 +0300)]
Eliminate unused selinux file context path macros

- These haven't been used by anything since rpm 4.8.x days,
  nowadays we just use selinux_file_context_path() instead
(cherry picked from commit 5f0bdf9e8af3dfc07aaa7c82671bec4915aaab78)

12 years agoFix quoting in brp-python-hardlink (patch from Jon Nelson)
Panu Matilainen [Mon, 23 Apr 2012 12:35:29 +0000 (15:35 +0300)]
Fix quoting in brp-python-hardlink (patch from Jon Nelson)
(cherry picked from commit 94eefb112875cb46501faff5752226f2346e0c62)

12 years agoPreparing for 4.10.0-beta1 rpm-4.10.0-beta1
Panu Matilainen [Mon, 23 Apr 2012 08:48:02 +0000 (11:48 +0300)]
Preparing for 4.10.0-beta1

12 years agoAdd a few basic test-cases for tilde in version comparison
Panu Matilainen [Mon, 23 Apr 2012 08:16:04 +0000 (11:16 +0300)]
Add a few basic test-cases for tilde in version comparison
(cherry picked from commit 0920d3339b706049d26e8cc18d8bf966616c2f32)

12 years agoAdd support for dpkg-style sorting of tilde in version/release
Michael Schroeder [Mon, 23 Apr 2012 08:04:02 +0000 (11:04 +0300)]
Add support for dpkg-style sorting of tilde in version/release

- This allows much nicer handling some common scenarios such as
  upstream pre-releases where the pre-release version would normally
  appear newer than final release, eg 1.0-rc1 vs 1.0. Previously this
  required mapping the pre-release tag into the release tag to achieve
  desired sorting, with tild this becomes simply 1.0~rc1 < 1.0.
- Add a rpmlib() tracking dependency to prevent older rpm versions
  from getting confused with packages relying on the new behavior.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit db28221a4a48f6ee3c804c92314330637c808638)

12 years agoAdd further version comparison test-cases
Panu Matilainen [Fri, 20 Apr 2012 10:29:21 +0000 (13:29 +0300)]
Add further version comparison test-cases

- Add pile of further tests for the more common constructs,
  collect various (old and new) corner cases from bugzilla.
(cherry picked from commit 4935f4853227d3981ba86d5557ae36704a1f67f2)

12 years agorpmdsMatchesDep() isn't correct on obsoletes
Panu Matilainen [Fri, 20 Apr 2012 06:31:17 +0000 (09:31 +0300)]
rpmdsMatchesDep() isn't correct on obsoletes

- Fix oversight in commit 9fb81eac0bcd239e46459f72916099f1adfc5cb9:
  rpmdsMatchesDep() works on provides, but obsoletes are matched on
  package name so we want rpmdsNVRMatchesDep(). rpmdsMatchesDep()
  "worked" as the implicit self-provide is always at the 0 index
  on packages created by modern rpmbuild, but this isn't really
  guaranteed: very old V3 rpms can have something else at the
  first index, and ditto for non-rpmbuild created packages.
- Thanks to Michael Schroeder for pointing this out.
(cherry picked from commit 5f1ec21518078e599b2499cf1ff852837ec33df7)

12 years agoAlways return NULL from fdFree()
Panu Matilainen [Wed, 18 Apr 2012 07:09:01 +0000 (10:09 +0300)]
Always return NULL from fdFree()

- Up to now, if the fd had remaining references fdFree() would return
  the supposedly free'd fd back to us, which is unlike anything else
  in rpm. Make this consistent with the rest of rpm finally as the
  last remaining caller requiring the old semantics is gone from
  the codebase (somewhere between 4.9 and 4.10): always return NULL,
  as the referenced instance is now gone as far as the caller is concerned.
(cherry picked from commit 4c1f7e335de1724661ce63c53186d161ab71a63f)

12 years ago- Add support for ppc64p7 architecture using new auxv parsing info
Phil Knirsch [Mon, 16 Apr 2012 17:05:18 +0000 (19:05 +0200)]
- Add support for ppc64p7 architecture using new auxv parsing info

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit f9eedd7f694a3dd3db637089f978dab4bd6858ee)

12 years ago- Add general /proc/self/auxv parsing to rpmrc for better machine detection
Phil Knirsch [Mon, 16 Apr 2012 17:02:34 +0000 (19:02 +0200)]
- Add general /proc/self/auxv parsing to rpmrc for better machine detection

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
(cherry picked from commit 280494cce023f3938023b9b2b1173405601e4ddf)

12 years agoUse a bit more complicated test for the install/remove file verification
Panu Matilainen [Tue, 17 Apr 2012 05:25:26 +0000 (08:25 +0300)]
Use a bit more complicated test for the install/remove file verification

- Previous test only used a single file and no package-specific
  directories, now we have multiple files and multiple directories,
  some owned by the package and some not.
- This test fails right now due to previously unnoticed regression
  in commit 1845c1d711b88723e596c88e8a7730a360029089
(cherry picked from commit bad173ef169905c7411f08208cf881be173d51dd)

12 years agoAxe unused leftover variable
Panu Matilainen [Mon, 16 Apr 2012 12:52:30 +0000 (15:52 +0300)]
Axe unused leftover variable

- Should've been in commit cf1095648194104a81a58abead05974a5bfa3b9a
(cherry picked from commit f5fdd5f9ca68d436ebb656299c1e1ba4488b2af9)

12 years agoDocument --obsoletes in manual (RhBug:809402)
Panu Matilainen [Mon, 16 Apr 2012 12:50:27 +0000 (15:50 +0300)]
Document --obsoletes in manual (RhBug:809402)
(cherry picked from commit ca9379c010d811b39775a23a4c737b7e0414f652)

12 years agoAdd test-cases for identical basenames within package
Panu Matilainen [Mon, 16 Apr 2012 11:14:37 +0000 (14:14 +0300)]
Add test-cases for identical basenames within package

- One test for the normal situation where identical basenames are
  not a problem, and another one where this causes a self-conflict
  because of a directory symlink.
(cherry picked from commit df475ec90cee171049ed7eb2edfcbba9b4d4993f)

12 years agoRaise file conflicts on differing device node numbers
Panu Matilainen [Fri, 13 Apr 2012 10:38:20 +0000 (13:38 +0300)]
Raise file conflicts on differing device node numbers

- For practical purposes, the "content" of a device node is its
  minor+major number, if those differ the files are very much
  not the same and thus cannot be shared.
(cherry picked from commit 8e4c7a56150407bd99edf29f009d1014a1d61626)

12 years agoRaise file conflicts on differing permissions (user, group, mode)
Panu Matilainen [Fri, 13 Apr 2012 10:16:51 +0000 (13:16 +0300)]
Raise file conflicts on differing permissions (user, group, mode)

- Two files (or directories) cannot be correctly shared if their
  permissions differ, even if the content is identical: either
  file will end up having wrong permissions, depending on installation
  order. This means a package can among other things silently
  eg relax permissions of eg security sensitive directory (accidentally
  or intentionallY).
- We now require exact match of user, group and entire file mode
  (previously only the file type part of mode was tested)
(cherry picked from commit cf1095648194104a81a58abead05974a5bfa3b9a)

12 years agoCheck for file conflicts within package (RhBug:808750)
Panu Matilainen [Thu, 12 Apr 2012 15:01:52 +0000 (18:01 +0300)]
Check for file conflicts within package (RhBug:808750)

- Packages having file conflicts with itself may seem absurd, but
  directory symlinks (such as /lib being a symlink to /usr/lib)
  make this entirely possible. This makes us catch and abort early
  on these cases instead of silently overwriting the self-conflicting
  files, potentially with disastrous results.
(cherry picked from commit 48c4ed1148cd617b67314353bf7859c1115884b3)

12 years agoCheck for file conflicts within package (RhBug:808750)
Panu Matilainen [Tue, 3 Apr 2012 03:11:11 +0000 (06:11 +0300)]
Check for file conflicts within package (RhBug:808750)

- Packages having file conflicts with itself may seem absurd, but
  directory symlinks (such as /lib being a symlink to /usr/lib)
  make this entirely possible. This makes us catch and abort early
  on these cases instead of silently overwriting the self-conflicting
  files, potentially with disastrous results.
(cherry picked from commit a13e56cd871a306fe48cd902c0ada0d825076a1f)

12 years agoChange file disposition code to access rpmfi's by index
Panu Matilainen [Thu, 12 Apr 2012 14:50:54 +0000 (17:50 +0300)]
Change file disposition code to access rpmfi's by index

- The final pre-requisite to handling file conflicts within a package:
  with this we're no longer tied to the single index per rpmfi. This
  is not supposed to change anything yet unless I screwed something up.
  Also goes to show that a semi-iterator interface for something
  that really needs random access only gets in the way rather than
  helping...
(cherry picked from commit 763341073355433b396d5a9219c5d374b3124837)

12 years agoChange rpmfi replaced size functions to take index
Panu Matilainen [Thu, 12 Apr 2012 14:39:57 +0000 (17:39 +0300)]
Change rpmfi replaced size functions to take index

- Further preliminaries to handle file conflicts within a package.
- These are internal-only interfaces so we can just change without
  bothering with compat wrappers.
(cherry picked from commit 87e7e88f901430312b697131a1e7d54f60e8678f)

12 years agoAdd rpmfiFooIndex() variants for the conflict handling methods
Panu Matilainen [Thu, 12 Apr 2012 14:39:32 +0000 (17:39 +0300)]
Add rpmfiFooIndex() variants for the conflict handling methods

- Preliminaries for handling file conflicts within a package:
  Using rpmfi's self-iterator limits access to the file info to
  one caller at a time, in order to self-file conflicts we'll need
  to be able to access the same rpmfi at different indexes simultaneously.
- As these are public API's, add compat wrappers for the self-iterator
  use (although AFAIK nothing except rpm itself uses these)
(cherry picked from commit 3f996a588a56141df146c33583a13c0542323977)

12 years agoFurther tweak the config file removal/backup logic to make it clearer
Panu Matilainen [Thu, 12 Apr 2012 14:27:24 +0000 (17:27 +0300)]
Further tweak the config file removal/backup logic to make it clearer

- Turn the strange negated condition around: when dealing with
  config files test for it directly. This way, all the special
  cases are handled first and normal cases fall through the if-jungle
  to exactly one case of rpmfsSetAction(fs, i, FA_ERASE). Makes
  the logic more obvious, at least to me.
(cherry picked from commit fbe424f202b32a42bed599739a687ce5bfebe92f)

12 years agoAvoid unnecessary calls to rpmfiFN()
Panu Matilainen [Thu, 12 Apr 2012 13:59:07 +0000 (16:59 +0300)]
Avoid unnecessary calls to rpmfiFN()

- handleOverlappedFiles() only needs the file name in a couple
  of relatively rare special cases. Constructing the fn more
  expensive than other rpmfi-calls, dont bother unless actually needed.
(cherry picked from commit b013a139d2a68033aa25cd27af457dc7129c73a0)

12 years agoMake config file modification detection a bit more readable
Panu Matilainen [Thu, 12 Apr 2012 13:27:08 +0000 (16:27 +0300)]
Make config file modification detection a bit more readable
(cherry picked from commit a359292046953e828b668cc1acd2aad9a26a21b5)

12 years agoMake rpmfiFNIndex() safe for callers on different indexes
Panu Matilainen [Thu, 12 Apr 2012 12:15:26 +0000 (15:15 +0300)]
Make rpmfiFNIndex() safe for callers on different indexes

- Previously this would return a pointer to an internal per-rpmfi buffer
  whose contents get silently overwritten on each call to rpmfiFNIndex(),
  making it unsafe for unsafe for random access for more than one
  active caller (such code does not currently exist in rpm though)
- Make rpmfiFNIndex() always return freshly allocated memory, and adjust
  the rpmfiFN() iteration wrapper to free and realloc the internal
  "buffer" on each call. It's a wee bit slower than before but it's
  not called *that* much, and if needed there are ways to optimize it.
(cherry picked from commit 11116a67864c119e420297984bd9ec4b83fdadd7)

12 years agoOops, automake isn't happy with comment here...
Panu Matilainen [Thu, 5 Apr 2012 13:57:29 +0000 (16:57 +0300)]
Oops, automake isn't happy with comment here...
(cherry picked from commit 2685bc0036750d93f1d43f8db2ce3b82159f3120)

12 years agoArrange unified /bin <-> $(bindir) in test-suite root
Panu Matilainen [Thu, 5 Apr 2012 11:21:27 +0000 (14:21 +0300)]
Arrange unified /bin <-> $(bindir) in test-suite root

- Rpm traditionally insists on putting itself into /bin and expects
  to find various things, especially /bin/sh there as well. This
  is normally the case, but on systems where the host /bin is symlink
  to eg /usr/bin, the test-suite /bin will be empty except for rpm
  itself causing a big number of bogus test-suite failures. Making
  test-suite root bin/ always a symlink to $(bindir) avoids this issue
  and works whether the host /bin is a real directory or not.
(cherry picked from commit b44b9ea94d229c07e56e242fa5625dea02de6a75)

12 years agoFix test-suite root population wrt "optional" directories
Panu Matilainen [Thu, 5 Apr 2012 10:27:51 +0000 (13:27 +0300)]
Fix test-suite root population wrt "optional" directories

- /proc, /sys and especially selinux directories are mostly Linux
  creatures and even those vary between versions. Use if to avoid
  the error code "leaking" in case the last directory is not present.
(cherry picked from commit 6cc1680082a34037b889d824b80a006081b97363)

12 years agoHandle obsolete matches (more) correctly in rpmal
Panu Matilainen [Thu, 5 Apr 2012 08:32:38 +0000 (11:32 +0300)]
Handle obsolete matches (more) correctly in rpmal

- Similar to commit 9fb81eac0bcd239e46459f72916099f1adfc5cb9 but
  on the to-be-installed set: obsoletes should only be matched against
  package names, not any provide or file names. Hasn't really mattered
  previously due to the way its called, but since commit
  05487d9a3f763cfed5f5ca75b4fbadb62f38dfd6 I guess it started to matter.
  It's more correct this way anyhow, and should fix RhBug:810077.
- Since rpmal only knows about provides, we need to handle obsoletes
  as a special case and filter out matches on provide names different
  than the matching package name.
(cherry picked from commit 8106e7e89c3c673f8eb7d2ed5027e2ee9750e3b5)

12 years agoRemove unused scareFlags member from rpmfi struct
Panu Matilainen [Wed, 4 Apr 2012 14:30:04 +0000 (17:30 +0300)]
Remove unused scareFlags member from rpmfi struct

- This is just a leftover from rpm < 4.7.x days
(cherry picked from commit b9c96a9fa9137f5bd26569466fd12c41a519c1f8)

12 years agoFix gpg-pubkey typos in Japanese manual (RhBug:760552)
Panu Matilainen [Tue, 3 Apr 2012 03:58:30 +0000 (06:58 +0300)]
Fix gpg-pubkey typos in Japanese manual (RhBug:760552)
(cherry picked from commit eaece70c1e80f6830b4a222f0ba47f4a75a0136b)

12 years agoValidate negated offsets too in headerVerifyInfo()
Panu Matilainen [Tue, 14 Feb 2012 09:27:46 +0000 (11:27 +0200)]
Validate negated offsets too in headerVerifyInfo()

- Undo the ancient broken fix for RhBug:71996 from commit
  9e06e3b8ca76ae55eaf2c4e37ba9cac729789014: instead of disabling
  the check, pass in the correct upper range which is entirely
  different from everything else for the region trailer tag.
- Fixes CVE-2012-0815
(cherry picked from commit 6fc6b45bf9fef0f17a2900c6c5198bda5e50d09e)

12 years agoDifferentiate between non-existent and invalid region tag
Panu Matilainen [Wed, 18 Jan 2012 08:56:35 +0000 (10:56 +0200)]
Differentiate between non-existent and invalid region tag

- Non-existent region tag is very different from existing but invalid
  one - the former is not an error but the latter one is, and needs
  to be handled as such. Previously an invalid region tag would cause
  us to treat it like rpm v3 package on entry, skipping all the region
  sanity checks and then crashing and burning later on when the immutable
  tag is fetched.
- Refer to REGION_TAG_TYPE instead of RPM_BIN_TYPE wrt the expected
  type of region tag for consistency and clarity, they are the same
  exact thing though.
- Should unify these damn copy-slop check one of these days, sigh...
  For now, settling for the easily backportable approach.
- Fixes the other half of CVE-2012-0060
(cherry picked from commit f23998251992b8ae25faf5113c42fee2c49c7f29)

12 years agoSpecifically validate region tag on header import
Panu Matilainen [Thu, 19 Jan 2012 06:25:15 +0000 (08:25 +0200)]
Specifically validate region tag on header import

- Region tags need to have very specific content, the generic
  header tag checks are not sufficient to ensure sanity. Verify
  the tag is one of the known region tags and that the entry has
  expected type and count.
- Fixes the first half of CVE-2012-0060
(cherry picked from commit e4eab2bc6d07cfd33f740071de7ddbb2fe2f4190)

12 years agoAxe leftover CANONARCH assignment messing up our "base" archs (RhBug:808250)
Panu Matilainen [Fri, 30 Mar 2012 06:56:43 +0000 (09:56 +0300)]
Axe leftover CANONARCH assignment messing up our "base" archs (RhBug:808250)

- This should've been in commit 2a8d03669732f68f02fa7b21ec87ee3f65d11e5b,
  the leftover CANONARCH resets the "base arch" we just set to a wrong
  value.
(cherry picked from commit 7c39c65da4b1b012061ffbac179a650643d00ba9)

12 years agoAccept files as command line arguments again in rpmdeps (RhBug:807767)
Panu Matilainen [Thu, 29 Mar 2012 08:26:57 +0000 (11:26 +0300)]
Accept files as command line arguments again in rpmdeps (RhBug:807767)

- Commit a25c3c7bac95ab7eb55f0ecf0b8793d8da341611 removed what was
  supposedly a non-supported method of passing files as arguments
  (instead of the normal stdin method) to rpmdeps. Turns out
  rpmdeps is even documented to take files as cli args, and that's
  how Fedora's %filter_setup macros are calling it...
- Allow files as arguments again, but in a way that doesn't cause
  argvFoo() vs popt crash-n-burn.
(cherry picked from commit fe252f21b370331016a952b085465cd97837aaef)

12 years agoDont bother building internal versions of db utilities we dont need
Panu Matilainen [Mon, 26 Mar 2012 10:03:03 +0000 (13:03 +0300)]
Dont bother building internal versions of db utilities we dont need

- rpmdb_dump, load, recover, verify, stat etc are useful at times,
  but these are not. This also fixes build with internal db for
  more recent versions of Berkeley DB.
(cherry picked from commit dd05fdd35f680dfff606731a664859ae45762bb1)

12 years agoEliminate broken data end calculation in dataLength()
Panu Matilainen [Fri, 23 Mar 2012 12:17:47 +0000 (14:17 +0200)]
Eliminate broken data end calculation in dataLength()

- If the caller doesn't know the end pointer, we dont have a whole lot
  of chance to come up with a reasonable one either. Just assume
  the terminating \0's are there when end boundary is not specified:
  when this happens we're dealing with relatively "trusted" data
  anyway, the more critical case of reading in unknown headers does
  always pass end pointers.
- While capping the end pointer to HEADER_DATA_MAX seems like a
  reasonable thing to do (as was done in commit
  f79909d04e43cbfbbcdc588530a8c8033c5e0a7c), it doesn't really help
  (bad data would likely run past bounds anyway), and it's not right
  either: the pointer can be to a stack address, and the stack can be
  near the top of addressable range, and ptr + HEADER_DATA_MAX can
  cause pointer wraparound. Notably that's exactly what happens
  when running 32bit personality process on 64bit system on Linux,
  at least in case of i386 process on x86_64, causing all sorts of
  breakage..
(cherry picked from commit 0b8c3218027c99a6d92c2ca53fe7f42cf87f30a4)

12 years agoOops, "magic eight" is necessary here afterall
Panu Matilainen [Thu, 22 Mar 2012 10:24:55 +0000 (12:24 +0200)]
Oops, "magic eight" is necessary here afterall

- Fix regression from commit 807b402d95702f3f91e9e2bfbd2b5ca8c9964ed9,
  the array gets passed as a pointer (how else would it work at all),
  so despite having seemingly correct type, sizeof(keyid) depends
  on the pointer size. This happens to be 8 on x86_64 and friends
  but breaks pgp fingerprint calculation on eg i386.
- Also return the explicit size from pgpExtractPubkeyFingerprint(),
  this has been "broken" for much longer but then all callers should
  really care about is -1 for error.
(cherry picked from commit 8a189c638386bee3906033857aa7268c1e0ca22c)