summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2017-05-24 00:36:27 +0000
committerjhb <jhb@FreeBSD.org>2017-05-24 00:36:27 +0000
commit5bfb3bddcec1852aae0171da5475116d11c0eff4 (patch)
treed96a1956b935331d8b88e9a34e09903d3c33c539 /lib
parent89d1a406f492b6e678811477533f719745bb178a (diff)
downloadFreeBSD-src-5bfb3bddcec1852aae0171da5475116d11c0eff4.zip
FreeBSD-src-5bfb3bddcec1852aae0171da5475116d11c0eff4.tar.gz
MFC 315283:
Fix sysdecode_cap_rights which currently prints bogus capability rights. PR: 217787
Diffstat (limited to 'lib')
-rw-r--r--lib/libsysdecode/flags.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/lib/libsysdecode/flags.c b/lib/libsysdecode/flags.c
index 61e7248..b4749bf 100644
--- a/lib/libsysdecode/flags.c
+++ b/lib/libsysdecode/flags.c
@@ -963,23 +963,15 @@ sysdecode_umtx_rwlock_flags(FILE *fp, u_long flags, u_long *rem)
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;
}
OpenPOWER on IntegriCloud