提交 d0d4b8ad 编写于 作者: J Jamie Strandboge 提交者: Daniel Veillard

AppArmor handling of accesses to readonly files

Fixes https://launchpad.net/bugs/453335

* src/security/virt-aa-helper.c: suppress confusing and misleading
  apparmor denied message when kvm/qemu tries to open a libvirt specified
  readonly file (such as a cdrom) with write permissions. libvirt uses
  the readonly attribute for the security driver only, and has no way
  of telling kvm/qemu that the device should be opened readonly
上级 dae7054b
......@@ -755,6 +755,10 @@ vah_add_file(virBufferPtr buf, const char *path, const char *perms)
}
virBufferVSprintf(buf, " \"%s\" %s,\n", tmp, perms);
if (readonly) {
virBufferVSprintf(buf, " # don't audit writes to readonly media\n");
virBufferVSprintf(buf, " deny \"%s\" w,\n", tmp);
}
clean:
free(tmp);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册