[PATCH 1/1] apparmor: use TEMPLATE.qemu for kvm

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

 



virDomainVirtTypeToString() returns 'qemu' and 'kvm' separately.
Don't require a separate apparmor profile for both, rather always
look for TEMPLATE.qemu.

Signed-off-by: Serge Hallyn <serge.hallyn@xxxxxxxxxx>
---
 src/security/virt-aa-helper.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index a06ba44..0447248 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -341,15 +341,19 @@ create_profile(const char *profile, const char *profile_name,
     int tlen, plen;
     int fd;
     int rc = -1;
+    const char *virttype;
 
     if (virFileExists(profile)) {
         vah_error(NULL, 0, _("profile exists"));
         goto end;
     }
 
+    virttype = virDomainVirtTypeToString(virtType);
+    if (strcmp(virttype, "kvm") == 0)
+	    virttype = "qemu";
 
     if (virAsprintfQuiet(&template, "%s/TEMPLATE.%s", APPARMOR_DIR "/libvirt",
-                         virDomainVirtTypeToString(virtType)) < 0) {
+                         virttype) < 0) {
         vah_error(NULL, 0, _("template name exceeds maximum length"));
         goto end;
     }
-- 
2.1.0

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