diff options
author | neal <neal> | 2008-08-15 11:18:38 +0000 |
---|---|---|
committer | neal <neal> | 2008-08-15 11:18:38 +0000 |
commit | 87bda0394f5399646c0b9872b9c9483d976edd2e (patch) | |
tree | 8902eede1aec8b0b4b4607bdeed425ab5b5111ab | |
parent | 2f4992bc5b1f1e996c1a6b8139754459d4f76434 (diff) |
2008-08-15 Neal H. Walfield <neal@gnu.org>
* server.c (server_loop): In the implementation of cap_read, if
the capability's type is not void, make sure that the capability
is valid. Otherwise, set the type to cap_void.
-rw-r--r-- | viengoos/ChangeLog | 6 | ||||
-rw-r--r-- | viengoos/server.c | 17 |
2 files changed, 17 insertions, 6 deletions
diff --git a/viengoos/ChangeLog b/viengoos/ChangeLog index d1c9b34..e3b88a7 100644 --- a/viengoos/ChangeLog +++ b/viengoos/ChangeLog @@ -1,3 +1,9 @@ +2008-08-15 Neal H. Walfield <neal@gnu.org> + + * server.c (server_loop): In the implementation of cap_read, if + the capability's type is not void, make sure that the capability + is valid. Otherwise, set the type to cap_void. + 2008-07-08 Neal H. Walfield <neal@gnu.org> * profile.h: Move to ../libc-parts. diff --git a/viengoos/server.c b/viengoos/server.c index 2d0c8a3..3b72606 100644 --- a/viengoos/server.c +++ b/viengoos/server.c @@ -1034,23 +1034,28 @@ server_loop (void) case RM_cap_read: { addr_t root_addr; - addr_t source_addr; + addr_t cap_addr; err = rm_cap_read_send_unmarshal (&msg, &principal_addr, &root_addr, - &source_addr); + &cap_addr); if (err) REPLY (err); DEBUG (4, ADDR_FMT "@" ADDR_FMT, - ADDR_PRINTF (root_addr), ADDR_PRINTF (source_addr)); + ADDR_PRINTF (root_addr), ADDR_PRINTF (cap_addr)); struct cap *root = ROOT (root_addr); - struct cap source = CAP (root, source_addr, -1, false); + struct cap cap = CAP (root, cap_addr, -1, false); + /* Even if CAP.TYPE is not void, the cap may not designate + an object. Looking up the object will set CAP.TYPE to + cap_void if this is the case. */ + if (cap.type != cap_void) + cap_to_object (principal, &cap); - rm_cap_read_reply_marshal (&msg, source.type, - CAP_PROPERTIES_GET (source)); + rm_cap_read_reply_marshal (&msg, cap.type, + CAP_PROPERTIES_GET (cap)); break; } |