libvirt/e44bcae-virt-aa-helper-trailing-slash.patch
Cédric Bosdonnat 37e0137a03 Accepting request 315860 from home:cbosdonnat:branches:Virtualization
Tue Jul  10 13:29:51 UTC 2015 - cbosdonnat@suse.com
- Fixed virt-aa-helper bugs preventing virt-sandbox to work.
  24f3c2f-virt-aa-helper-fix-caps.patch
  61dab0f-virt-aa-helper-renaming.patch
  a55a5e7-virt-aa-helper-log.patch
  e44bcae-virt-aa-helper-trailing-slash.patch
  bsc#936841
- Fixed crasher due to uninitialized values
  qemu-nbd-cleanup-fix.patch bsc#936841

OBS-URL: https://build.opensuse.org/request/show/315860
OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=470
2015-07-10 12:21:25 +00:00

29 lines
1.0 KiB
Diff

From e44bcae9f014946d66fad1164080a4e251197f19 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=A9dric=20Bosdonnat?= <cbosdonnat@suse.com>
Date: Wed, 24 Jun 2015 09:56:04 +0200
Subject: [PATCH 1/5] virt-aa-helper: fix rules for paths with trailing slash
Rules generated for a path like '/' were having '//' which isn't
correct for apparmor. Make virt-aa-helper smarter to avoid these.
---
src/security/virt-aa-helper.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index 4440552..18454c8 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -795,6 +795,9 @@ vah_add_path(virBufferPtr buf, const char *path, const char *perms, bool recursi
goto cleanup;
}
+ if (tmp[strlen(tmp) - 1] == '/')
+ tmp[strlen(tmp) - 1] = '\0';
+
virBufferAsprintf(buf, " \"%s%s\" %s,\n", tmp, recursive ? "/**" : "", perms);
if (readonly) {
virBufferAddLit(buf, " # don't audit writes to readonly files\n");
--
2.1.4