svn commit: r318764 - stable/11/lib/libsysdecode

John Baldwin jhb at FreeBSD.org
Wed May 24 00:36:28 UTC 2017


Author: jhb
Date: Wed May 24 00:36:27 2017
New Revision: 318764
URL: https://svnweb.freebsd.org/changeset/base/318764

Log:
  MFC 315283:
  Fix sysdecode_cap_rights which currently prints bogus capability rights.
  
  PR:		217787

Modified:
  stable/11/lib/libsysdecode/flags.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libsysdecode/flags.c
==============================================================================
--- stable/11/lib/libsysdecode/flags.c	Wed May 24 00:00:55 2017	(r318763)
+++ stable/11/lib/libsysdecode/flags.c	Wed May 24 00:36:27 2017	(r318764)
@@ -963,23 +963,15 @@ sysdecode_umtx_rwlock_flags(FILE *fp, u_
 	return (print_mask_0ul(fp, umtxrwlockflags, flags, rem));
 }
 
-/* XXX: This should be in <sys/capsicum.h> */
-#define	CAPMASK(right)	((right) & (((uint64_t)1 << 57) - 1))
-
 void
 sysdecode_cap_rights(FILE *fp, cap_rights_t *rightsp)
 {
 	struct name_table *t;
-	int idx;
 	bool comma;
 
 	comma = false;
 	for (t = caprights; t->str != NULL; t++) {
-		idx = ffs(CAPIDXBIT(t->val)) - 1;
-		if (CAPARSIZE(rightsp) < idx)
-			continue;
-		if ((rightsp->cr_rights[CAPIDXBIT(t->val)] & CAPMASK(t->val)) ==
-		    CAPMASK(t->val)) {
+		if (cap_rights_is_set(rightsp, t->val)) {
 			fprintf(fp, "%s%s", comma ? "," : "", t->str);
 			comma = true;
 		}


More information about the svn-src-all mailing list