mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
Skip file-based security checks for network disks
Network disks are accessed by qemu directly, and have no associated file on the host, so checking for file ownership etc. is unnecessary. Signed-off-by: Josh Durgin <joshd@hq.newdream.net>
This commit is contained in:
parent
2954eb7b35
commit
ee3efc41e6
@ -8353,7 +8353,7 @@ int virDomainDiskDefForeachPath(virDomainDiskDefPtr disk,
|
||||
size_t depth = 0;
|
||||
char *nextpath = NULL;
|
||||
|
||||
if (!disk->src)
|
||||
if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
|
||||
return 0;
|
||||
|
||||
if (disk->driverType) {
|
||||
|
@ -144,7 +144,7 @@ qemuSecurityDACRestoreSecurityImageLabelInt(virSecurityDriverPtr drv ATTRIBUTE_U
|
||||
if (disk->readonly || disk->shared)
|
||||
return 0;
|
||||
|
||||
if (!disk->src)
|
||||
if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
|
||||
return 0;
|
||||
|
||||
/* If we have a shared FS & doing migrated, we must not
|
||||
|
@ -619,7 +619,7 @@ AppArmorSetSecurityImageLabel(virSecurityDriverPtr drv,
|
||||
if (secdef->type == VIR_DOMAIN_SECLABEL_STATIC)
|
||||
return 0;
|
||||
|
||||
if (!disk->src)
|
||||
if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
|
||||
return 0;
|
||||
|
||||
if (secdef->imagelabel) {
|
||||
|
@ -436,7 +436,7 @@ SELinuxRestoreSecurityImageLabelInt(virSecurityDriverPtr drv ATTRIBUTE_UNUSED,
|
||||
if (disk->readonly || disk->shared)
|
||||
return 0;
|
||||
|
||||
if (!disk->src)
|
||||
if (!disk->src || disk->type == VIR_DOMAIN_DISK_TYPE_NETWORK)
|
||||
return 0;
|
||||
|
||||
/* If we have a shared FS & doing migrated, we must not
|
||||
|
Loading…
Reference in New Issue
Block a user