Allow a base label to be specified in dynamic labelling mode

Normally the dynamic labelling mode will always use a base
label of 'svirt_t' for VMs. Introduce a <baselabel> field
in the <seclabel> XML to allow this base label to be changed

eg

   <seclabel type='dynamic' model='selinux'>
     <baselabel>system_u:object_r:virt_t:s0</baselabel>
   </seclabel>

* docs/schemas/domain.rng: Add <baselabel>
* src/conf/domain_conf.c, src/conf/domain_conf.h: Parsing
  of base label
* src/qemu/qemu_process.c: Don't reset 'model' attribute if
  a base label is specified
* src/security/security_apparmor.c: Refuse to support base label
* src/security/security_selinux.c: Use 'baselabel' when generating
  label, if available
This commit is contained in:
Daniel P. Berrange
2011-06-23 15:48:48 +01:00
parent 49826eda7a
commit 4ebfc42716
6 changed files with 75 additions and 23 deletions

View File

@@ -67,6 +67,9 @@
<element name="imagelabel">
<text/>
</element>
<element name="baselabel">
<text/>
</element>
</element>
</define>
<define name="hvs">