From: Serge Hallyn Date: Tue, 11 Dec 2012 20:20:30 +0000 (+0000) Subject: add vnc unix sockets to apparmor policy X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=a4e44e674eb833af10c74af0c297dd5b3e60fa67;p=libvirt.git add vnc unix sockets to apparmor policy When using vnc gaphics over a unix socket, virt-aa-helper needs to provide access for the qemu domain to access the sockfile. Signed-off-by: Serge Hallyn --- diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c index e480b305bd..888c416c85 100644 --- a/src/security/virt-aa-helper.c +++ b/src/security/virt-aa-helper.c @@ -1003,6 +1003,13 @@ get_files(vahControl * ctl) if (vah_add_file(&buf, ctl->def->os.loader, "r") != 0) goto clean; + for (i = 0; i < ctl->def->ngraphics; i++) { + if (ctl->def->graphics[i]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC && + ctl->def->graphics[i]->data.vnc.socket && + vah_add_file(&buf, ctl->def->graphics[i]->data.vnc.socket, "rw")) + goto clean; + } + if (ctl->def->ngraphics == 1 && ctl->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_SDL) if (vah_add_file(&buf, ctl->def->graphics[0]->data.sdl.xauth, diff --git a/tests/virt-aa-helper-test b/tests/virt-aa-helper-test index f14db8b0a9..af91c615ec 100755 --- a/tests/virt-aa-helper-test +++ b/tests/virt-aa-helper-test @@ -319,6 +319,9 @@ testme "0" "sdl Xauthority" "-r -u $valid_uuid" "$test_xml" sed -e "s,###UUID###,$uuid,g" -e "s,###DISK###,$disk1,g" "$template_xml" > "$test_xml" testme "0" "hugepages" "-r -u $valid_uuid -F /run/hugepages/kvm/\*\*" "$test_xml" +sed -e "s,###UUID###,$uuid,g" -e "s,###DISK###,$disk1,g" -e "s,,,g" "$template_xml" > "$test_xml" +testme "0" "vnc socket" "-r -u $valid_uuid" "$test_xml" + testme "0" "help" "-h" echo "" >$output