[PATCH 4/3] security_dac: Don't return uninitialised uid and gid for image labels

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

 



As in the previous commit also images are chowned to uninitialised
values if the label is not present.
---
As this fix is identical to already ACKed 3/3, I'm pushing this as trivial.
---
 src/security/security_dac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 2527759..5de7391 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -152,7 +152,7 @@ int virSecurityDACParseImageIds(virDomainDefPtr def,
         return -1;

     seclabel = virDomainDefGetSecurityLabelDef(def, SECURITY_DAC_NAME);
-    if (seclabel == NULL) {
+    if (seclabel == NULL || seclabel->imagelabel == NULL) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("security label for DAC not found in domain %s"),
                        def->name);
-- 
1.7.12

--
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]