mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-05 07:38:20 +02:00
audit: only check for CAP_AUDIT_WRITE once, during initialization
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89225 Reviewed-by: Colin Walters <walters@verbum.org> Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
parent
e3e388a1ef
commit
2602ca61c5
1 changed files with 5 additions and 5 deletions
10
bus/audit.c
10
bus/audit.c
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue