Author: kevans
Date: Wed Oct 23 03:23:14 2019
New Revision: 353914
URL: https://svnweb.freebsd.org/changeset/base/353914

Log:
  cap_sysctl: correct typo from r347534-ish
  
  operation & ~limit where limit is a bool is clearly not what was intended,
  given the line prior. Correct it to use the calculated mask for validation.
  
  The cap_sysctl tests should now be functional again.

Modified:
  head/lib/libcasper/services/cap_sysctl/cap_sysctl.c

Modified: head/lib/libcasper/services/cap_sysctl/cap_sysctl.c
==============================================================================
--- head/lib/libcasper/services/cap_sysctl/cap_sysctl.c Wed Oct 23 03:15:27 
2019        (r353913)
+++ head/lib/libcasper/services/cap_sysctl/cap_sysctl.c Wed Oct 23 03:23:14 
2019        (r353914)
@@ -316,7 +316,7 @@ sysctl_valid(const nvlist_t *nvl, bool limit)
                         */
                        mask = limit ? (CAP_SYSCTL_RDWR |
                            CAP_SYSCTL_RECURSIVE) : CAP_SYSCTL_RDWR;
-                       if ((operation & ~limit) != 0 ||
+                       if ((operation & ~mask) != 0 ||
                            (operation & CAP_SYSCTL_RDWR) == 0)
                                return (EINVAL);
                        /* Only one 'operation' can be present. */
_______________________________________________
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