diff options
author | Paul Moore <paul@paul-moore.com> | 2017-09-01 15:45:05 +0200 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2017-11-10 22:07:57 +0100 |
commit | 5d842a5b77a58160625548fa6be2dc159179ffdb (patch) | |
tree | da0f32735645658f01ff6bec624fa6b9a04b4cd3 /kernel/audit.c | |
parent | audit: convert audit_ever_enabled to a boolean (diff) | |
download | linux-5d842a5b77a58160625548fa6be2dc159179ffdb.tar.xz linux-5d842a5b77a58160625548fa6be2dc159179ffdb.zip |
audit: use audit_set_enabled() in audit_enable()
Use audit_set_enabled() to enable auditing during early boot. This
obviously won't emit an audit change record, but it will work anyway
and should help prevent in future problems by consolidating the
enable/disable code in one function.
Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index f0cf9bfc806c..67b3863261d4 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -1575,8 +1575,8 @@ static int __init audit_enable(char *str) if (audit_default == AUDIT_OFF) audit_initialized = AUDIT_DISABLED; - audit_enabled = audit_default; - audit_ever_enabled = !!audit_enabled; + if (audit_set_enabled(audit_default)) + panic("audit: error setting audit state (%d)\n", audit_default); pr_info("%s\n", audit_default ? "enabled (after initialization)" : "disabled (until reboot)"); |