X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fupdate-utmp%2Fupdate-utmp.c;h=ee9105bf47c2eb01b88d7cf1703b1fe6178f344c;hb=80037e4d17d0c8f28d0ff610902babc9e2b4e2f9;hp=ec07b921256b1a0ad97f91cbd0b0e90ba85ba5e2;hpb=dce818b390a857a11f7dd634684500675cf79833;p=elogind.git diff --git a/src/update-utmp/update-utmp.c b/src/update-utmp/update-utmp.c index ec07b9212..ee9105bf4 100644 --- a/src/update-utmp/update-utmp.c +++ b/src/update-utmp/update-utmp.c @@ -250,7 +250,8 @@ 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, "init", NULL, NULL, NULL, 1) < 0) { + if (audit_log_user_message(c->audit_fd, AUDIT_SYSTEM_BOOT, "init", NULL, NULL, NULL, 1) < 0 && + errno != EPERM) { log_error("Failed to send audit message: %m"); r = -errno; } @@ -278,7 +279,8 @@ 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, "init", NULL, NULL, NULL, 1) < 0) { + if (audit_log_user_message(c->audit_fd, AUDIT_SYSTEM_SHUTDOWN, "init", NULL, NULL, NULL, 1) < 0 && + errno != EPERM) { log_error("Failed to send audit message: %m"); r = -errno; } @@ -330,7 +332,8 @@ static int on_runlevel(Context *c) { runlevel > 0 ? runlevel : 'N') < 0) return -ENOMEM; - if (audit_log_user_message(c->audit_fd, AUDIT_SYSTEM_RUNLEVEL, s, NULL, NULL, NULL, 1) < 0) { + if (audit_log_user_message(c->audit_fd, AUDIT_SYSTEM_RUNLEVEL, s, NULL, NULL, NULL, 1) < 0 && + errno != EPERM) { log_error("Failed to send audit message: %m"); r = -errno; }