]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virSecuritySELinuxSetFileconHelper: Don't fail on read-only NFS
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 17 Jan 2014 11:57:13 +0000 (12:57 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 17 Jan 2014 12:35:01 +0000 (13:35 +0100)
commitd1fdecb6240cab8872fd39b0a6dd0df1ebd52b86
tree952432f61f747c52ae5aa7cd17e9b2b503e4b650
parent42358e3a0a0f5bc9ba939d39eb4dcaa9c359aa7b
virSecuritySELinuxSetFileconHelper: Don't fail on read-only NFS

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

When starting up a domain, the SELinux labeling is done depending on
current configuration. If the labeling fails we check for possible
causes, as not all labeling failures are fatal. For example, if the
labeled file is on NFS which lacks SELinux support, the file can still
be readable to qemu process. These cases are distinguished by the errno
code: NFS without SELinux support returns EOPNOTSUPP. However, we were
missing one scenario. In case there's a read-only disk on a read-only
NFS (and possibly any FS) and the labeling is just optional (not
explicitly requested in the XML) there's no need to make the labeling
error fatal. In other words, read-only file on read-only NFS can fail to
be labeled, but be readable at the same time.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/security/security_selinux.c