You need to sign in or sign up before continuing.
  • C
    virt-aa-helper: fix parsing security labels by introducing VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL · dffdac06
    Christian Ehrhardt 提交于
    When virt-aa-helper parses xml content it can fail on security labels.
    
    It fails by requiring to parse active domain content on seclabels that
    are not yet filled in.
    
    Testcase with virt-aa-helper on a minimal xml:
     $ cat << EOF > /tmp/test.xml
    <domain type='kvm'>
        <name>test-seclabel</name>
        <uuid>12345678-9abc-def1-2345-6789abcdef00</uuid>
        <memory unit='KiB'>1</memory>
        <os><type arch='x86_64'>hvm</type></os>
        <seclabel type='dynamic' model='apparmor' relabel='yes'/>
        <seclabel type='dynamic' model='dac' relabel='yes'/>
    </domain>
    EOF
     $ /usr/lib/libvirt/virt-aa-helper -d -r -p 0 \
       -u libvirt-12345678-9abc-def1-2345-6789abcdef00 < /tmp/test.xml
    
    Current Result:
     virt-aa-helper: error: could not parse XML
     virt-aa-helper: error: could not get VM definition
    Expected Result is a valid apparmor profile
    Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
    Signed-off-by: NGuido Günther <agx@sigxcpu.org>
    dffdac06
domain_conf.h 105.2 KB