From 56ba2f99a587f9582ca960165ad67eea18075bb2 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Fri, 3 Jul 2015 19:01:34 +0000 Subject: [PATCH] virt-aa-helper: add unix channels for nserials as well 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 --- 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 13f8a6a69e..4440552a35 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",