summaryrefslogtreecommitdiff
path: root/viengoos/cap-lookup.c
diff options
context:
space:
mode:
authorneal <neal>2007-11-28 18:15:20 +0000
committerneal <neal>2007-11-28 18:15:20 +0000
commita9b17e6236a493d7f5354a7ebc0723ded83bc2bd (patch)
tree70681561764de74763af8df052f2280b205248da /viengoos/cap-lookup.c
parentd6f5f00a87b6d0d9667715988ddfb7384dceefc2 (diff)
hurd/
2007-11-28 Neal H. Walfield <neal@gnu.org> * cap.h (cap_types_compatible): New function. viengoos/ 2007-11-28 Neal H. Walfield <neal@gnu.org> * cap-lookup.c (lookup): Use cap_types_compatible to determine whether two types are compatible.
Diffstat (limited to 'viengoos/cap-lookup.c')
-rw-r--r--viengoos/cap-lookup.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/viengoos/cap-lookup.c b/viengoos/cap-lookup.c
index af1fac0..b1de9cd 100644
--- a/viengoos/cap-lookup.c
+++ b/viengoos/cap-lookup.c
@@ -105,8 +105,9 @@ lookup (activity_t activity,
int guard = extract_bits64_inv (addr, remaining - 1, gdepth);
if (CAP_GUARD (root) != guard)
{
- debug (1, "Guard 0x%llx/%d does not match 0x%llx's "
- "bits %d-%d => 0x%x",
+ debug (1, "Translating " ADDR_FMT ": guard 0x%llx/%d does "
+ "not match 0x%llx's bits %d-%d => 0x%x",
+ ADDR_PRINTF (address),
CAP_GUARD (root), CAP_GUARD_BITS (root), addr,
remaining - gdepth, remaining - 1, guard);
return false;
@@ -242,10 +243,7 @@ lookup (activity_t activity,
if (! cap_is_a (root, type))
/* Types don't match. They may, however, be compatible. */
{
- if (((cap_is_a (root, cap_rpage) || cap_is_a (root, cap_page))
- && (type == cap_rpage || type == cap_page))
- || ((cap_is_a (root, cap_rcappage) || cap_is_a (root, cap_cappage))
- && (type == cap_rcappage || type == cap_cappage)))
+ if (cap_types_compatible (root->type, type))
/* Type are compatible. We just need to downgrade the
rights. */
w = false;