[libvirt] [PATCH] virt-aa-helper: add unix channels for nserials as well

Serge Hallyn serge.hallyn at ubuntu.com
Fri Jul 3 19:01:34 UTC 2015


Commit 03d7462d added it for channels, but it is also needed for serials.  Add
it for serials, parallels, and consoles as well.

This solves https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1015154

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 src/security/virt-aa-helper.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 13f8a6a..4440552 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -951,8 +951,10 @@ get_files(vahControl * ctl)
             (ctl->def->serials[i]->source.type == VIR_DOMAIN_CHR_TYPE_PTY ||
              ctl->def->serials[i]->source.type == VIR_DOMAIN_CHR_TYPE_DEV ||
              ctl->def->serials[i]->source.type == VIR_DOMAIN_CHR_TYPE_FILE ||
+             ctl->def->serials[i]->source.type == VIR_DOMAIN_CHR_TYPE_UNIX ||
              ctl->def->serials[i]->source.type == VIR_DOMAIN_CHR_TYPE_PIPE) &&
-            ctl->def->serials[i]->source.data.file.path)
+            ctl->def->serials[i]->source.data.file.path &&
+            ctl->def->serials[i]->source.data.file.path[0] != '\0')
             if (vah_add_file_chardev(&buf,
                                      ctl->def->serials[i]->source.data.file.path,
                                      "rw",
@@ -964,8 +966,10 @@ get_files(vahControl * ctl)
             (ctl->def->consoles[i]->source.type == VIR_DOMAIN_CHR_TYPE_PTY ||
              ctl->def->consoles[i]->source.type == VIR_DOMAIN_CHR_TYPE_DEV ||
              ctl->def->consoles[i]->source.type == VIR_DOMAIN_CHR_TYPE_FILE ||
+             ctl->def->consoles[i]->source.type == VIR_DOMAIN_CHR_TYPE_UNIX ||
              ctl->def->consoles[i]->source.type == VIR_DOMAIN_CHR_TYPE_PIPE) &&
-            ctl->def->consoles[i]->source.data.file.path)
+            ctl->def->consoles[i]->source.data.file.path &&
+            ctl->def->consoles[i]->source.data.file.path[0] != '\0')
             if (vah_add_file(&buf,
                              ctl->def->consoles[i]->source.data.file.path, "rw") != 0)
                 goto cleanup;
@@ -975,8 +979,10 @@ get_files(vahControl * ctl)
             (ctl->def->parallels[i]->source.type == VIR_DOMAIN_CHR_TYPE_PTY ||
              ctl->def->parallels[i]->source.type == VIR_DOMAIN_CHR_TYPE_DEV ||
              ctl->def->parallels[i]->source.type == VIR_DOMAIN_CHR_TYPE_FILE ||
+             ctl->def->parallels[i]->source.type == VIR_DOMAIN_CHR_TYPE_UNIX ||
              ctl->def->parallels[i]->source.type == VIR_DOMAIN_CHR_TYPE_PIPE) &&
-            ctl->def->parallels[i]->source.data.file.path)
+            ctl->def->parallels[i]->source.data.file.path &&
+            ctl->def->parallels[i]->source.data.file.path[0] != '\0')
             if (vah_add_file_chardev(&buf,
                                      ctl->def->parallels[i]->source.data.file.path,
                                      "rw",
-- 
2.1.4




More information about the libvir-list mailing list