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

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



---
 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 b8d1a92..7a6f9c9 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


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