]> git.ipfire.org Git - thirdparty/libvirt.git/commit
security: Manage SELinux labels on shared/readonly hostdev's
authorJohn Ferlan <jferlan@redhat.com>
Wed, 26 Nov 2014 17:35:46 +0000 (12:35 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Tue, 9 Dec 2014 15:48:38 +0000 (10:48 -0500)
commitf36d9285cda0ffae5efe804b9c81e2f0e651da39
tree16187754d4e05040152a69f14c792d6c8c38da6d
parent048237e3dbe4dac93c97c5877d815286f4393fb3
security: Manage SELinux labels on shared/readonly hostdev's

https://bugzilla.redhat.com/show_bug.cgi?id=1082521

Support for shared hostdev's was added in a number of commits, initially
starting with 'f2c1d9a80' and most recently commit id 'fd243fc4' to fix
issues with the initial implementation.  Missed in all those changes was
the need to mimic the virSELinux{Set|Restore}SecurityDiskLabel code to
handle the "shared" (or shareable) and readonly options when Setting
or Restoring the SELinux labels.

This patch will adjust the virSecuritySELinuxSetSecuritySCSILabel to not
use the virSecuritySELinuxSetSecurityHostdevLabelHelper in order to set
the label. Rather follow what the Disk code does by setting the label
differently based on whether shareable/readonly is set.  This patch will
also modify the virSecuritySELinuxRestoreSecuritySCSILabel to follow
the same logic as virSecuritySELinuxRestoreSecurityImageLabelInt and not
restore the label if shared/readonly
src/security/security_selinux.c