mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Treat failure to relabel stdin_path as non-fatal on NFS
NFS does not support file labelling, so ignore this error for stdin_path when on NFS. * src/security/security_selinux.c: Ignore failures on labelling stdin_path on NFS * src/util/storage_file.c, src/util/storage_file.h: Refine virStorageFileIsSharedFS() to allow it to check for a specific FS type.
This commit is contained in:
@@ -1023,9 +1023,12 @@ SELinuxSetSecurityAllLabel(virSecurityDriverPtr drv,
|
||||
SELinuxSetFilecon(vm->def->os.initrd, default_content_context) < 0)
|
||||
return -1;
|
||||
|
||||
if (stdin_path &&
|
||||
SELinuxSetFilecon(stdin_path, default_content_context) < 0)
|
||||
return -1;
|
||||
if (stdin_path) {
|
||||
if (SELinuxSetFilecon(stdin_path, default_content_context) < 0 &&
|
||||
virStorageFileIsSharedFSType(stdin_path,
|
||||
VIR_STORAGE_FILE_SHFS_NFS) != 1)
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user