Bug 554829 - SELinux handling could be done better.
Summary: SELinux handling could be done better.
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libguestfs
Version: unspecified
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact:
URL:
Whiteboard:
Depends On: 1089100
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-12 18:55 UTC by Daniel Walsh
Modified: 2016-07-14 14:47 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-07-14 14:47:13 UTC
Embargoed:


Attachments (Terms of Use)

Description Daniel Walsh 2010-01-12 18:55:07 UTC
Description of problem:

If a guest OS supports SELinux you should default the guestfish to --selinux and load the policy.  Otherwise files created by guestfish will have no labels and cause SELinux headaches when the machine boots.

You can either parse /etc/selinux/config looking for the SELINUX= lines to determine whether selinux is enabled or use the libselinux function.

extern int selinux_init_load_policy(int *enforce);

Comment 1 Richard W.M. Jones 2010-01-12 19:03:23 UTC
I discussed several features with Dan Walsh which make sense to
implement to make SELinux handling more robust in virt-v2v and
libguestfs in general.  They are:

(1) virt-inspector should find out if the guest OS supports selinux,
and the default enablement state.

(2) virt-inspector to support the --selinux flag based on above.

(3) replace sh load_policy advice in
http://libguestfs.org/guestfs.3.html#selinux with a direct call to
selinux_init_load_policy

(4) add an API to get the security context from
selinux_failsafe_context_path


Note You need to log in before you can comment on or make changes to this bug.