Commit 2602ca61 authored by Simon McVittie's avatar Simon McVittie

audit: only check for CAP_AUDIT_WRITE once, during initialization

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89225Reviewed-by: Colin Walters's avatarColin Walters <walters@verbum.org>
Signed-off-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
parent e3e388a1
......@@ -52,6 +52,11 @@ void
bus_audit_init (BusContext *context)
{
#ifdef HAVE_LIBAUDIT
capng_get_caps_process ();
if (!capng_have_capability (CAPNG_EFFECTIVE, CAP_AUDIT_WRITE))
return;
audit_fd = audit_open ();
if (audit_fd < 0)
......@@ -83,11 +88,6 @@ bus_audit_get_fd (void)
#ifdef HAVE_LIBAUDIT
if (audit_fd >= 0)
{
capng_get_caps_process ();
if (!capng_have_capability (CAPNG_EFFECTIVE, CAP_AUDIT_WRITE))
return -1;
return audit_fd;
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment