]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: fix audit exit status
authorKarel Zak <kzak@redhat.com>
Thu, 27 Feb 2020 13:04:55 +0000 (14:04 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 27 Feb 2020 13:04:55 +0000 (14:04 +0100)
According to audit_log_user_message(3) result 1 is "success" and 0 is
"failed", we use standard EXIT_{SUCCESS,FAILURE} macros with reverse
status.

Addresses: https://github.com/karelzak/util-linux/issues/966
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/hwclock.c

index 1191a857159a8d5a5c3a62ae5c79d68a0f0aa143..89d8a1fd93716f587bb83f809afd632a8721a675 100644 (file)
@@ -1464,7 +1464,7 @@ hwclock_exit(const struct hwclock_control *ctl
        if (ctl->hwaudit_on && !ctl->testing) {
                audit_log_user_message(hwaudit_fd, AUDIT_USYS_CONFIG,
                                       "op=change-system-time", NULL, NULL, NULL,
-                                      status);
+                                      status == EXIT_SUCCESS ? 1  : 0);
        }
        close(hwaudit_fd);
 #endif