]> err.no Git - systemd/commitdiff
audit: smaller fixes to audit hookup
authorLennart Poettering <lennart@poettering.net>
Wed, 11 Aug 2010 13:19:50 +0000 (15:19 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 11 Aug 2010 13:19:50 +0000 (15:19 +0200)
src/manager.c
src/update-utmp.c

index e32b24ff516da78bf895e82044f67b474fbeaa13..9c962ca8153a4168e23f918c7d5797d6e3f38dd0 100644 (file)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
+
+#ifdef HAVE_AUDIT
 #include <libaudit.h>
+#endif
 
 #include "manager.h"
 #include "hashmap.h"
index b8b0d36ae7536e8518c68d172f55b841c3476221..d0236867a78ebb8ac7879d5bebd0d9457b6be06d 100644 (file)
 
 #include <dbus/dbus.h>
 
+#ifdef HAVE_AUDIT
+#include <libaudit.h>
+#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;