mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
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.
This commit is contained in:
parent
b7ea58c262
commit
e44bcae9f0
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user