Commit Graph

10212 Commits

Author SHA1 Message Date
Steve Lawrence f3bcf9a18c Add a generic plugin for use by simple Collections
This patch adds a generic plugin, exec.so, that should be sufficient for the
majority of Collection actions. After all packages in a Collection have been
installed/removed, this plugin executes the arguments by calling system(3),
allowing for a very generic and powerful method to perform many actions.

This also adds two sample macros as examples of the format, using the exec.so
plugin.
2010-06-22 11:12:43 +03:00
Steve Lawrence 85d89bafdc Determine when to perform Collection actions
There are three times during a transaction when Collection actions can be
performed:

1) After the last time a member of a collection is either installed or removed
2) After the last time a member of a collection is installed only
3) Before the first time a member of a collection is removed only

This patch adds three lists to the rpmte structure to mark which transaction
elements fall into each of these groups, and the collections that caused that.
A new function is added to the TSM to scan through all the transaction elements
and update these lists. When a collection is added to one of these lists, it
signifies that when that transaction element is installed, the appropriate
action should be performed for that collection.
2010-06-22 11:12:43 +03:00
Steve Lawrence 04bdec775a Add plugin calling support
This patch adds a simple plugin system that makes simple problems easy to
solve, and difficult problems, such as SELinux, possible.

When the transaction gets to the point where a collection action should occur,
it expands a macro of the form %__collection_<collection name> to get the path
to a plugin and any additional options. The plugin is dlopen'ed, and the
appropriate function is called in the plugin, with the additional arguments
passed in.

This also adds a --nocollections option to disable performing Collection
actions.
2010-06-22 11:12:43 +03:00
Steve Lawrence 2fd0913a6a Add common Collection requirements
This patch adds the install-time feature that if a package requires a package
in a collection, then it also requires all other packages in that collection.
This has the effect that collections will be roughly grouped together during a
transaction.

Although this is not absolutely necessary for the majority of collections, it
is required for the SELinux collection. This is because all SELinux policies
must be installed before the applications they secure to ensure correct labels.
This means we must ensure packages in the selinux collection are ordered
earlier in the transaction than all applications they protect. Adding this
implicit runtime requirements achieves this in a general manner, without major
modifications to dependency ordering.

To accomplish this, this patch splits the addRelation function into two parts:
one that determines which relations to add, and one that actually adds them.
After the usual relation is added between two packages, it then determines if
the required package contains any collections. If so, it finds all other
packages that are in the same collections and creates additional relations.
2010-06-22 11:12:43 +03:00
Steve Lawrence 0158708305 Add new Collections preamble tag
This adds a new Collections preamble tag, which contains a space separated list
of collection names that the package belongs to.
2010-06-22 11:12:43 +03:00
Héctor Daniel Cabrera d6795bee66 l10n: Updated Spanish (Castilian) (es) translation to 100%
New status: 724 messages complete with 0 fuzzies and 0 untranslated.

Transmitted-via: Transifex (www.transifex.net).
2010-06-14 15:45:49 +00:00
Panu Matilainen 33197fd4b1 Dont bother with selinux contexts in test transactions
- initializing contexts isn't exactly cheap, and test transactions
  have no use for them
2010-06-11 08:20:32 +03:00
Panu Matilainen 89be57ad92 If there are no hardlinks, dont bother with s-bit and caps removal 2010-06-11 08:17:12 +03:00
Tadashi Jokagi 0d61354b48 l10n: Updated Japanese (ja) translation to 97%
New status: 707 messages complete with 9 fuzzies and 8 untranslated.

Transmitted-via: Transifex (www.transifex.net).
2010-06-07 22:12:12 +00:00
Tadashi Jokagi 7b9d87a044 l10n: Updated Japanese (ja) translation to 97%
New status: 705 messages complete with 10 fuzzies and 9 untranslated.

Transmitted-via: Transifex (www.transifex.net).
2010-06-07 22:10:29 +00:00
Panu Matilainen 61f5bea69e Oops, bad format spec in Finnish translation 2010-06-07 14:01:02 +03:00
Panu Matilainen 36e8e3d9fe Eliminate fuzzies from Finnish translation 2010-06-07 13:14:52 +03:00
Panu Matilainen cbb37abb4f Update .gitignore a bit 2010-06-07 12:51:09 +03:00
Yuri Chornoivan d8e99d2076 l10n: Updated Ukrainian (uk) translation to 100%
New status: 724 messages complete with 0 fuzzies and 0 untranslated.

Transmitted-via: Transifex (www.transifex.net).
2010-06-06 05:40:03 +00:00
Piotr Drąg c19d846176 l10n: Updated Polish (pl) translation to 100%
New status: 724 messages complete with 0 fuzzies and 0 untranslated.

Transmitted-via: Transifex (www.transifex.net).
2010-06-03 18:45:25 +00:00
Panu Matilainen 15c0c4e7a1 Fix "empty reply from server" curl-syndrome with url retrieval (RhBug:598988)
- We were adding a trailing newline to urlhelper command line passed
  to execvp(), with the newline ending up in the URL passed to curl.
  Many servers dont seem to mind the extra newline, but some do. Oh well...
2010-06-03 16:22:09 +03:00
Panu Matilainen 4d172a194a Remove POSIX file capabilities from executables on erase/rename too
- Just like suid/sgid bits, hardlinks to executables with capabilities
  set can "leak" permissions to old, potentially vulnerable versions
  of binaries. Related to RhBug:598775.
2010-06-03 11:04:12 +03:00
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