[PATCH v4 4/4] security: restore DAC for every disk file in disk chain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/security/security_dac.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 0d6defc..577db8e 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -335,6 +335,16 @@ err:
     return rc;
 }
 
+static int
+virSecurityDACRestoreDiskSecurityFileLabel(virDomainDiskDefPtr disk ATTRIBUTE_UNUSED,
+                                           const char *path,
+                                           size_t depth ATTRIBUTE_UNUSED,
+                                           void *opaque ATTRIBUTE_UNUSED)
+{
+    return virSecurityDACRestoreSecurityFileLabel(path);
+}
+
+
 
 static int
 virSecurityDACSetSecurityFileLabel(virDomainDiskDefPtr disk ATTRIBUTE_UNUSED,
@@ -424,7 +434,10 @@ virSecurityDACRestoreSecurityImageLabelInt(virSecurityManagerPtr mgr,
         }
     }
 
-    return virSecurityDACRestoreSecurityFileLabel(disk->src);
+    return virDomainDiskDefForeachPath(disk,
+                                       false,
+                                       virSecurityDACRestoreDiskSecurityFileLabel,
+                                       NULL);
 }
 
 
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]