audit: use bool for audit log choice
We weren't ever using the value for anything other than being non-zero. * src/util/viraudit.h (virAuditLog): Change signature. * src/util/viraudit.c (virAuditLog): Update user. * daemon/libvirtd.c (main): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
233ecdea71
commit
0fe384f38e
@ -1443,7 +1443,7 @@ int main(int argc, char **argv) {
|
|||||||
VIR_DEBUG("Proceeding without auditing");
|
VIR_DEBUG("Proceeding without auditing");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
virAuditLog(config->audit_logging);
|
virAuditLog(config->audit_logging > 0);
|
||||||
|
|
||||||
/* setup the hooks if any */
|
/* setup the hooks if any */
|
||||||
if (virHookInitialize() < 0) {
|
if (virHookInitialize() < 0) {
|
||||||
|
@ -53,7 +53,7 @@ VIR_LOG_INIT("util.audit");
|
|||||||
#if WITH_AUDIT
|
#if WITH_AUDIT
|
||||||
static int auditfd = -1;
|
static int auditfd = -1;
|
||||||
#endif
|
#endif
|
||||||
static int auditlog = 0;
|
static bool auditlog;
|
||||||
|
|
||||||
int virAuditOpen(void)
|
int virAuditOpen(void)
|
||||||
{
|
{
|
||||||
@ -70,7 +70,7 @@ int virAuditOpen(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void virAuditLog(int logging)
|
void virAuditLog(bool logging)
|
||||||
{
|
{
|
||||||
auditlog = logging;
|
auditlog = logging;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* viraudit.h: auditing support
|
* viraudit.h: auditing support
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010-2011 Red Hat, Inc.
|
* Copyright (C) 2010-2011, 2014 Red Hat, Inc.
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -34,7 +34,7 @@ typedef enum {
|
|||||||
|
|
||||||
int virAuditOpen(void);
|
int virAuditOpen(void);
|
||||||
|
|
||||||
void virAuditLog(int enabled);
|
void virAuditLog(bool enabled);
|
||||||
|
|
||||||
void virAuditSend(virLogSourcePtr source,
|
void virAuditSend(virLogSourcePtr source,
|
||||||
const char *filename, size_t linenr, const char *funcname,
|
const char *filename, size_t linenr, const char *funcname,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user