mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-28 16:45:26 +00:00
audit: properly encode device path in cgroup audit
https://bugzilla.redhat.com/show_bug.cgi?id=922186 Commitd04916fa
introduced a regression in audit quality - even though the code was computing the proper escaped name for a path, it wasn't feeding that escaped name on to the audit message. As a result, /var/log/audit/audit.log would mention a pair of fields class=path path=/dev/hpet instead of the intended class=path path="/dev/hpet", which in turn caused ausearch to format the audit log with path=(null). * src/conf/domain_audit.c (virDomainAuditCgroupPath): Use constructed encoding. Signed-off-by: Eric Blake <eblake@redhat.com> (cherry picked from commit31c6bf35b9
)
This commit is contained in:
parent
610aadd635
commit
0b0ecdfc6d
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* domain_audit.c: Domain audit management
|
* domain_audit.c: Domain audit management
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2012 Red Hat, Inc.
|
* Copyright (C) 2006-2013 Red Hat, Inc.
|
||||||
* Copyright (C) 2006 Daniel P. Berrange
|
* Copyright (C) 2006 Daniel P. Berrange
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
@ -471,8 +471,8 @@ virDomainAuditCgroupPath(virDomainObjPtr vm, virCgroupPtr cgroup,
|
|||||||
rdev = virDomainAuditGetRdev(path);
|
rdev = virDomainAuditGetRdev(path);
|
||||||
|
|
||||||
if (!(detail = virAuditEncode("path", path)) ||
|
if (!(detail = virAuditEncode("path", path)) ||
|
||||||
virAsprintf(&extra, "path path=%s rdev=%s acl=%s",
|
virAsprintf(&extra, "path %s rdev=%s acl=%s",
|
||||||
path, VIR_AUDIT_STR(rdev), perms) < 0) {
|
detail, VIR_AUDIT_STR(rdev), perms) < 0) {
|
||||||
VIR_WARN("OOM while encoding audit message");
|
VIR_WARN("OOM while encoding audit message");
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user