Author: pfg
Date: Fri Apr  8 03:26:21 2016
New Revision: 297694
URL: https://svnweb.freebsd.org/changeset/base/297694

Log:
  audit(8): leave unsigned comparison for last.
  
  aq64_minfree is unsigned so comparing to find out if it is less
  than zero is a nonsense. Move the comparison to the last position
  as we don't want to spend time if any of the others triggers first.
  
  hile it would be tempting to just remove it, it may be important to
  keep  it for portability with platforms where may be signed(?) or
  in case we may want to change it in the future.

Modified:
  head/sys/security/audit/audit_syscalls.c

Modified: head/sys/security/audit/audit_syscalls.c
==============================================================================
--- head/sys/security/audit/audit_syscalls.c    Fri Apr  8 01:57:40 2016        
(r297693)
+++ head/sys/security/audit/audit_syscalls.c    Fri Apr  8 03:26:21 2016        
(r297694)
@@ -303,8 +303,8 @@ sys_auditon(struct thread *td, struct au
                            (udata.au_qctrl64.aq64_lowater >=
                            udata.au_qctrl.aq_hiwater) ||
                            (udata.au_qctrl64.aq64_bufsz > AQ_MAXBUFSZ) ||
-                           (udata.au_qctrl64.aq64_minfree < 0) ||
-                           (udata.au_qctrl64.aq64_minfree > 100))
+                           (udata.au_qctrl64.aq64_minfree > 100) ||
+                           (udata.au_qctrl64.aq64_minfree < 0))
                                return (EINVAL);
                        audit_qctrl.aq_hiwater =
                            (int)udata.au_qctrl64.aq64_hiwater;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to