Commit Graph

8 Commits

Author SHA1 Message Date
Panu Matilainen 454859f3cb Only sepolicy-plugin needs linking to libsemanage 2010-12-22 14:58:11 +02:00
Panu Matilainen 00463e2fe0 Move rpmtsSELabelFoo() functions to an internal-only header
- The sepolicy plugin needs them so the symbols can't be hidden, but
  these are not something external API-users should be messing with.
- Ultimately we'll want to push the actual labeling from FSM to
  the plugin, insulating rpm from all SELinux specifics, this is
  just a band-aid temporary "solution" to keep this out of the API.
2010-12-21 11:01:22 +02:00
Panu Matilainen ec6226dd17 Move plugins out of rpm config directory
- Plugins are by their very nature arch specific, while /usr/lib/rpm
  is a hodgepodge of all sorts of ... stuff, most of which is
  arch-independent and all. Use %{_libdir}/rpm-plugins to cleanly
  differentiate 32 vs 64bit plugin paths
2010-10-12 17:05:17 +03:00
Panu Matilainen 8f7874c193 Fix up bunch of silly int vs rpmRC return code mismatches 2010-09-21 11:37:21 +03:00
Steve Lawrence 46cdd1b507 Add SELinux policy plugin
This adds a new plugin specifically for a collection to load SELinux
policy. This implements the post_add and pre_remove plugin hooks. The
only time anything happens during the pre_remove hook is if post_add was
not called (i.e.  if the transaction only removes policies).

This plugin extracts all the policy information from packages in the
sepolicy collection during the open te hook. It then determines which
policies should be installed/removed based on if the package is being
installed/removed and the type of the policy and the system policy. It
then executes semodule (or uses libsemanage if semodule cannot be
executed or installing in a chroot) to remove and install the necessary
policies. It then reloads the selinux state, reloads the file contexts,
and if necessary, relabels the file system.
2010-09-01 09:31:03 +03:00
Steve Lawrence 883f13c8b7 Update the plugin architecture to allow for remembering state
This moves most of the plugin logic to a new rpmplugins file with a
struct and functions for managing plugins, allowing for plugins to carry
state. This also adds init and cleanup hooks for plugins to initialize
and cleanup their state, and a new 'open te' hook allowing plugins to
read and save information from transaction elements.

This also generalizes the plugin architecture a bit so it isn't so
specific to collections.
2010-09-01 09:04:05 +03:00
Panu Matilainen deb24a5698 Make rpmChrootIn/Out() accessible to plugins
- the exec plugin was using a private copy of rpmchroot.c to avoid
  RPM_GNUC_INTERNAL on the API, better let the plugins use librpm
  state instead
- the chroot API really belongs to librpmio but for now...
2010-06-23 14:49:01 +03:00
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