]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
audit: don't use simple_strtol() anymore
authorPaul Moore <paul@paul-moore.com>
Fri, 1 Sep 2017 13:44:51 +0000 (09:44 -0400)
committerPaul Moore <paul@paul-moore.com>
Fri, 10 Nov 2017 21:07:50 +0000 (16:07 -0500)
The simple_strtol() function is deprecated, use kstrtol() instead.

Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
kernel/audit.c

index db71c45ea6f8c0e0eca72d54ea08ffa846baa176..e75918f79a83653c24d2e75d72ecac61cfedd10c 100644 (file)
@@ -1567,8 +1567,13 @@ postcore_initcall(audit_init);
 /* Process kernel command-line parameter at boot time.  audit=0 or audit=1. */
 static int __init audit_enable(char *str)
 {
-       audit_default = !!simple_strtol(str, NULL, 0);
-       if (!audit_default)
+       long val;
+
+       if (kstrtol(str, 0, &val))
+               panic("audit: invalid 'audit' parameter value (%s)\n", str);
+       audit_default = (val ? AUDIT_ON : AUDIT_OFF);
+
+       if (audit_default == AUDIT_OFF)
                audit_initialized = AUDIT_DISABLED;
        audit_enabled = audit_default;
        audit_ever_enabled = !!audit_enabled;