]> git.ipfire.org Git - thirdparty/libvirt.git/commit
ignore SELinuxSetFilecon error in SELinuxSetSecurityFileLabel if on nfs
authorLaine Stump <laine@laine.org>
Wed, 10 Nov 2010 19:39:43 +0000 (14:39 -0500)
committerLaine Stump <laine@laine.org>
Thu, 11 Nov 2010 16:43:06 +0000 (11:43 -0500)
commit5b04f42c6ff03c31fe9ab76cbe25b466b590fef2
tree09e3d3f1b56d80551f75ae29692485f2452a4e32
parenta926156792eb0b124e0af43bc64467779e31130d
ignore SELinuxSetFilecon error in SELinuxSetSecurityFileLabel if on nfs

If virDomainAttachDevice() was called with an image that was located
on a root-squashed NFS server, and in a directory that was unreadable
by root on the machine running libvirtd, the attach would fail due to
an attempt to change the selinux label of the image with EACCES (which
isn't covered as an ignore case in SELinuxSetFilecon())

NFS doesn't support SELinux labelling anyway, so we mimic the failure
handling of commit 93a18bbafaf11729d3ca1241e11bee133d77fa77, which
just ignores the errors if the target is on an NFS filesystem (in
SELinuxSetSecurityAllLabel() only, though.)

This can be seen as a follow-on to commit
347d266c51705f4987fa5ce2a0ecb314ed8745ce, which ignores file open
failures of files on NFS that occur directly in
virDomainDiskDefForeachPath() (also necessary), but does not ignore
failures in functions that are called from there (eg
SELinuxSetSecurityFileLabel()).
src/security/security_selinux.c