Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 8 Apr 2016 03:26:21 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r297694 - head/sys/security/audit
Message-ID:  <201604080326.u383QL2b042615@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604080326.u383QL2b042615>