Commit Graph

11 Commits

Author SHA1 Message Date
Panu Matilainen d763c09e28 Eliminate now unnecessary WITH_SELINUX conditionals in sepolicy plugin 2012-10-11 15:14:48 +03:00
Ales Kozumplik 7a530738ca remove the 'path' parameter of rpmtsSELabelInit()
- It is always selinux_file_context_path() anyway.
2012-01-12 14:27:36 +01:00
Ales Kozumplik 7a8b75d266 selinux: reopen label between transactions if necessary (RhBug: 746073) 2012-01-12 14:27:36 +01:00
Panu Matilainen 70f063cb77 Make base64 encoding/decoding part of rpmio public API
- Base64 is present in headers and all, it's only reasonable that
  our API users have access to this functionality without having
  to link to other libraries. Even if we didn't want to carry the
  implementation forever in our codebase, we should provide a wrapping
  for this (much like the other crypto stuff) for the reason stated above.
- A bigger issue is that our dirty little (badly hidden) secret was using
  non-namespaced function names, clashing with at least beecrypt. And we
  couldn't have made these internal-only symbols even on platforms that
  support it, because they are used all over the place outside rpmio.
  So... rename the b64 functions to rpmLikeNamingStyle and make 'em public.
  No functional changes, just trivial renaming despite touching numerous
  places.
2011-11-09 15:16:28 +02:00
Panu Matilainen 52e0467126 Fix up one strict-prototype warning that has crept in meantime 2011-09-01 20:29:30 +03:00
Panu Matilainen 77a7bfed02 Remove trailing dead NULL-assignments from sepoltransFree()
- Replace assignments with a memset() to blast away the contents instead,
  taking care of other members too
2011-05-30 12:25:04 +03:00
Panu Matilainen 7c75179e46 Minor cleanups to sepolLoadPolicies() in sepolicy plugin
- Having an err label which we fall through on success too seems
  a bit funny, rename the label to exit
- Initialize the sepoltrans at declaration already
- Remove redundant RPMRC_FAIL assignment on sepoltransNew() fail
  case, this already assumes failure
- Remove redundant jump to exit from sepoltransCommit() error
- Eliminate trailing dead NULL assignment of the local pt variable
2011-05-30 12:12:24 +03:00
Panu Matilainen 2d46bfbfd9 Return explicit NULL on sepoltransNew() failure 2011-05-30 12:05:19 +03: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 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