From: Lennart Poettering Date: Wed, 11 Aug 2010 13:19:50 +0000 (+0200) Subject: audit: smaller fixes to audit hookup X-Git-Tag: v8~126 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=830f6caa77edbdafabba0869a205f2ba5095f758 audit: smaller fixes to audit hookup --- diff --git a/src/manager.c b/src/manager.c index e32b24ff5..9c962ca81 100644 --- a/src/manager.c +++ b/src/manager.c @@ -36,7 +36,10 @@ #include #include #include + +#ifdef HAVE_AUDIT #include +#endif #include "manager.h" #include "hashmap.h" diff --git a/src/update-utmp.c b/src/update-utmp.c index b8b0d36ae..d0236867a 100644 --- a/src/update-utmp.c +++ b/src/update-utmp.c @@ -28,6 +28,10 @@ #include +#ifdef HAVE_AUDIT +#include +#endif + #include "log.h" #include "macro.h" #include "util.h" @@ -244,7 +248,7 @@ static int on_reboot(Context *c) { #ifdef HAVE_AUDIT if (c->audit_fd >= 0) - if (audit_log_user_message(c->audit_fd, AUDIT_SYSTEM_BOOT, "", NULL, NULL, NULL, 1) < 0) { + if (audit_log_user_message(c->audit_fd, AUDIT_SYSTEM_BOOT, "init", NULL, NULL, NULL, 1) < 0) { log_error("Failed to send audit message: %m"); r = -errno; } @@ -272,7 +276,7 @@ static int on_shutdown(Context *c) { #ifdef HAVE_AUDIT if (c->audit_fd >= 0) - if (audit_log_user_message(c->audit_fd, AUDIT_SYSTEM_SHUTDOWN, "", NULL, NULL, NULL, 1) < 0) { + if (audit_log_user_message(c->audit_fd, AUDIT_SYSTEM_SHUTDOWN, "init", NULL, NULL, NULL, 1) < 0) { log_error("Failed to send audit message: %m"); r = -errno; } @@ -308,7 +312,7 @@ static int on_runlevel(Context *c) { previous = 0; } - /* Second get new runlevel */ + /* Secondly, get new runlevel */ if ((runlevel = get_current_runlevel(c)) < 0) return runlevel;