Commit Graph

10495 Commits

Author SHA1 Message Date
Panu Matilainen ca2d6b2b48 Strip s-bits on upgrade too (RhBug:598775)
- Previously only actual package removal would clear s-bits from
  s[ug]id files. This needs to be done on upgrade too to prevent
  leaving vulnerable hardlinks of s[ug]id binaries around.
2010-06-02 09:15:48 +03:00
Tadashi Jokagi 49b4dea69d l10n: Updates to Japanese (ja) translation
New status: 664 messages complete with 47 fuzzies and 13 untranslated.

Transmitted-via: Transifex (www.transifex.net).
2010-06-02 00:01:13 +00:00
Panu Matilainen ccb545f0e9 Refactor rpmdb lookups + caching to a helper function + cosmetics
- no functional changes (supposedly ;) just cleaning things up a bit
2010-06-01 16:14:48 +03:00
Panu Matilainen 7a8b716187 On colored transactions, require matching arch for freshen (RhBug:553108)
- What we'd really want to compare here is the color or ISA of the packages
  but color isn't realiable as eg -devel packages often aren't correctly
  colored, and ISA isn't currently available in the header as a standalone
  entry. Comparing arch prevents otherwise reasoable i386 -> i686 type
  arch changes on freshen but at least it avoids the most pathological
  issues.
2010-06-01 14:03:28 +03:00
Panu Matilainen cadab3afa5 Permit DOS line-endings in PGP armors (RhBug:532992)
- RFC-4880 doesn't requires unix-style line-endings, we shouldn't either.
  This is probably still oversly strict as RFC-4880 appears to permit
  any whitespace to follow armor headers but ... shrug.
2010-06-01 11:58:42 +03:00
Panu Matilainen 84621fa7e1 Support many pubkeys in a single file in --import (RhBug:586827) 2010-06-01 10:41:09 +03:00
Panu Matilainen ddec80b614 Don't return errors on trying to import duplicate keys
- On the principle of "no news is good news", if we already have the
  keys to be imported, then everything is ok. The former behavior is
  just confusing as witnessed in RhBug:462979
2010-06-01 10:41:09 +03:00
Panu Matilainen 099a45a5b9 Nuke leftover variable from the chroot workout 2010-05-31 18:00:33 +03:00
Panu Matilainen 8687f255a4 Update translations to pick up chroot-related string changes 2010-05-31 17:01:53 +03:00
Panu Matilainen f2bfa2edfc Use the new chroot API everywhere, eliminate old related goo 2010-05-31 14:11:12 +03:00
Panu Matilainen 90a37c2f5c Add a simple API for dealing with chroot state changes
- Chroot is a process global state so it needs to be tracked globally.
  A process can (in theory) have several transaction sets, each with
  different roots (although only one can be active at any time), so
  associating the chroot state with transaction set (as currently done)
  is not right.
- "Reference count" chroot entering and exiting so callers dont need
  to track the state changes individually when they need to go
  in and out of chroot if not already done.
- This should probably go to librpmio eventually but as there are no
  needs outside librpm currently, keeping this internal so we're free
  to fiddle with the api if necessary
2010-05-31 13:35:54 +03:00
Panu Matilainen a795c69c20 Eliminate unused no-op FSM_CHROOT stage
- the fsm thingie doesn't need to deal with chroot issues: except for
  build where it doesn't matter, its only called from psm where the
  chroot is already taken care of
2010-05-31 13:29:43 +03:00
Panu Matilainen 1dd5b084bd Add internal helper for formatting file attribute strings
- Eliminates some copy-paste slopping. Verify code traditionally only
  shows the first attribute, take care to keep that format to avoid
  breaking scripts unnecessarily
2010-05-28 12:57:59 +03:00
Panu Matilainen 00f1a6e0b1 Add header extension tag RPMTAG_FILESTATUS for file verification
- Permits basic file verification with just a headerGet(), with some
  caveats: there's no way to control which attributes get verified,
  and there's no filtering of mtime differences of shared files. Those
  aside, rpm -q --qf "[%{filestates:vflags} %{filenames}\n] <args>" now
  performs the same as "rpm -V --nodeps --noscripts <args>"
2010-05-28 12:21:34 +03:00
Panu Matilainen ac0ab016a5 Add internal helper for formatting verify flags 2010-05-28 12:18:26 +03:00
Panu Matilainen a6c8e49023 Move shared file timestamp filtering out of rpmVerifyFile()
- rpmVerifyFile() reports things as they are in reality - if timestamps
  on disk differ to header then it reports it. Filtering on the result
  belongs to the code interpreting the results.
2010-05-28 10:49:58 +03:00
Panu Matilainen be1c4872c1 Dont crash on NULL ts to rpmtsInitIterator() 2010-05-28 10:27:01 +03:00
Panu Matilainen 3f38850609 Only pass the info we actually care about to verifyHeader() 2010-05-28 09:57:09 +03:00
Panu Matilainen f4bbfed800 Eliminate unused argument to verifyDependencies() 2010-05-28 09:51:51 +03:00
Panu Matilainen 591c5c3fbb Clean up verify script handling a bit
- test verifyscript existence in rpmVerifyScript() instead of caller,
  making it safe+correct for calling on any header
- eliminate unused/unnecessary arguments, local variables and bogus leftover
  comments
2010-05-28 09:49:28 +03:00
Panu Matilainen 5c6795bf43 Handle test-transaction centrally on entry to psm
- psm in test-mode is a no-op anyway, so dont bother at all with it
- also removes the need to check for test mode on pre/posttrans scripts,
  these are now fully covered by psm too
2010-05-26 13:25:39 +03:00
Panu Matilainen 614c52090b Eliminate rpmts from the scriptlet machinery
- pass scriptFd and selinux enabled status as arguments from psm level
- selinux status could be queried directly with is_selinux_enabled()
  but that's a fairly expensive call which does all sorts of funny
  things and probably doesn't work at all in the average chroot
- Lua-scripts dont currently honor scriptFd and have no use for selinux
  but pass the info there too as an early step towards supporting
  scriptFd with Lua
- makes rpmScriptRun() even more of an argument monster, some of this
  should probably go into rpmScript struct...
2010-05-26 11:36:43 +03:00
Panu Matilainen c9f74ddd0a Simplify chroot handling wrt scriptlets
- switch root if necessary on entry and exit to psm already, nothing
  inside the psm needs access to outside chroot
- eliminate chroot handling from scriptlet machinery, dealing with
  chroot is a job for higher levels
- Lua scriptlets can change our cwd, always ensure we return to previous
  cwd after executing by saving and restoring the cwd
2010-05-26 10:15:06 +03:00
Panu Matilainen 2c54c6abbf Move scriptlet statistics collection (back) inside psm
- removes one rpmts dependency from scriptlets
2010-05-25 15:38:15 +03:00
Jindrich Novy a2b999df2e Put the macro evaluation in spec comments back.
- '#' at the beginning doesn't need to always represent comment in spec
  but can be part of the embedded bash script (RhBug:594672 - comment 6)
2010-05-24 09:39:54 +02:00
Panu Matilainen 0e04c09d48 Move the lone hashFunctionString() into misc.[ch], eliminate rpmhash.[ch]
- Besides there not being much point in having a separate source + header
  for a small single function, this fixes build on case-insensitive
  systems such as Mac OS X.
2010-05-21 15:36:03 +03:00
Jindrich Novy 8cb7b9085c Do not evaluate macros in spec comments (RhBug:594672) 2010-05-21 13:12:02 +02:00
Till Maas 2d468d2cd9 Search all locale dirs in find-lang.sh, not just those under share/ (#159) 2010-05-20 11:35:16 +03:00
Panu Matilainen e63293b0ea Use pgpValString() for :pgpsig header formatting (RhBug:587755)
- instead of copy-slopping (and forgetting to do so whenever something
  changes) just use the values we know from pgpVals..
2010-05-19 15:33:52 +03:00
Panu Matilainen 2be413810c Add public pgpValString() function + enum for the various types
- The equivalent used to be possible in 4.4.x era as the value tables
  were all exported, but this way we need to export far less
  and the implementation details stay internal.
2010-05-19 15:32:54 +03:00
Panu Matilainen 072815887f Bury struct pgpValTbl_s definition inside rpmpgp.c
- as all the value tables are static inside rpmpgp.c, exposing this
  is pointless (should've been unexported long time ago)
2010-05-19 14:59:02 +03:00
Panu Matilainen 0e0e332b46 Handle non-existent dependency sets in python (RhBug:593553)
- rpmdsNew() returns NULL if the requested dependency type doesn't
  exist in the header. The C-side API can handle NULL to all rpmds
  "methods" and this is how librpm deals with non-existent sets rather
  than waste memory on for empty ds structures. However the python side
  wasn't expecting NULL for legal requests (but not setting error either)
  and thus blowing up with SystemError exception.
- Raise TypeError on illegal arguments to rpm.ds constructor, and present
  non-existent dependency sets as empty rpm.ds objects to python. This
  lets python callers use iteration over ds items regardless of whether
  the dependency actually exists or not. The alternative of returning
  None (or raising exceptions) would break existing code for no
  particularly good reason.
2010-05-19 10:12:43 +03:00
Panu Matilainen 2b7884ce29 Fix return from chroot() on verify (RhBug:590588)
- a couple of important steps in chroot() in and out sequence missing,
  causing "No such file or directory" whining on return from chroot()
  unless cwd happened to be /
2010-05-18 10:43:05 +03:00
Roland McGrath e6a0b0e566 Make debugedit -i recompute build ID only when any DWARF was actually changed. 2010-05-11 15:09:53 +03:00
Roland McGrath c4b6362353 Whitespace fixups for tools/debugedit.c 2010-05-11 15:09:52 +03:00
Panu Matilainen 1d7e1f66e1 Plug dumb memleak in rpmpsMerge() 2010-05-07 20:24:01 +03:00
Panu Matilainen 6fc3cbefee Fix breakage from removedPackages changing to hash
- tsmem->delta is still needed for tsmem->order reallocation,
  zero delta causes funny effects on larger package sets (test suite
  doesnt trigger this)
2010-05-07 20:22:53 +03:00
Panu Matilainen 775cbf8bf2 Revert back to rpmdbRemove() taking instance number instead of actual header
- On package reinstall (ie --replacepkgs) we only know the old header
  by the instance number, and grabbing the header from the db in
  psm as a special case for that is more trouble than just doing what
  we always did.
- Reverts commit e16695e932 and unbreaks
  the --replacepkgs test case
2010-05-07 15:25:38 +03:00
Panu Matilainen f051801373 Convert rpmte internals to use the transaction pointer from element itself 2010-05-07 14:31:25 +03:00
Panu Matilainen 8f7c2d7063 Store pointer to transaction set in transaction elements
- unused now but allows various new things and more element "independency"
- eliminate the unused dboffset argument while at it
2010-05-07 14:16:18 +03:00
Florian Festi 0782ee6b71 Fix compiler warning in rpmhash Resize() 2010-05-07 13:06:40 +02:00
Florian Festi fe6967d5a3 Remove no longer needed function intcmp() 2010-05-06 16:32:40 +02:00
Florian Festi 70e9b035ff Convert tsmem->removedPackages to a hash table and remove rpmdbPruneIterator from the API 2010-05-06 16:07:56 +02:00
Florian Festi 9fad36f0ed rpmhash: new Empty() function to remove all entries 2010-05-06 16:07:56 +02:00
Florian Festi aafd8500d3 rpmhash: Accessor functions for the size and usage 2010-05-06 16:07:56 +02:00
Florian Festi 030f7dde13 rpmhash: Grow when hash table gets too full
Add some statistics to be able to find out how full the hash is
2010-05-06 16:07:56 +02:00
Panu Matilainen 869004e8fb Move header filecount retrieve from addTE() to rpmfsNew() 2010-05-06 15:12:41 +03:00
Panu Matilainen 27869a5233 Tolerate NULL in rpmfsFree() and rpmfsFC()
- both are "can't happen" situations but easy to handle cleanly here...
2010-05-06 15:09:47 +03:00
Panu Matilainen 63dcd3d497 Minor cleanup to rpmfsNew()
- use xcalloc() to ensure clean state, no need to manually do it all
- group non-conditional and conditional operations together
2010-05-06 15:09:39 +03:00
Panu Matilainen 118fba2295 Move delTE() inline to rpmteFree()
- no point splitting this up, its just straightforward freeing of stuff
- dont bother with tonne of assigning everything to NULL, it gets
  zeroed out by memset() anyway
2010-05-06 15:09:12 +03:00