[PATCH 3/6] conf: forbid seclabel duplicates for domain devices

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

 



Parser checks for per-domain seclabel duplicates, so it would be nice if
it checked for per-device seclabel duplicates the same way

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1165485
---
 src/conf/domain_conf.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a36dace..c43aded 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5323,6 +5323,15 @@ virSecurityDeviceLabelDefParseXML(virSecurityDeviceLabelDefPtr **seclabels_rtn,
                     break;
                 }
             }
+
+            /* check for duplicate seclabels */
+            for (j = 0; j < i; j++) {
+                if (STREQ_NULLABLE(model, seclabels[j]->model)) {
+                    virReportError(VIR_ERR_XML_DETAIL,
+                                   _("seclabel for model %s is already provided"), model);
+                    goto error;
+                }
+            }
             seclabels[i]->model = model;
         }
 
-- 
1.9.3

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