diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-09-22 23:53:19 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-09-22 23:53:19 +0200 |
commit | ea9d181f270aa903a2f31d2d00deb18c1be9792e (patch) | |
tree | 27f3855ac9375e08f92464cbc2e0659c4d2404b5 | |
parent | 131ce3a37dc93eaa62f3b7643772afa9276ed2d5 (diff) |
Fix spurious destroy during RPC to self with rendez-vous
In that case we have two receive right references, which we should consume
one per one, instead of destroying them all at once (and thus fail on second
destroy)
http://lists.gnu.org/archive/html/bug-hurd/2011-03/msg00045.html
* libfshelp/fetch-root.c (fshelp_fetch_root): Unreference rendez-vous port
receive right instead of destroying the port.
* libshouldbeinlibc/exec-reauth.c (exec_reauth): Likewise.
-rw-r--r-- | libfshelp/fetch-root.c | 2 | ||||
-rw-r--r-- | libshouldbeinlibc/exec-reauth.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libfshelp/fetch-root.c b/libfshelp/fetch-root.c index 54d3c0ca..eb569896 100644 --- a/libfshelp/fetch-root.c +++ b/libfshelp/fetch-root.c @@ -79,7 +79,7 @@ fshelp_fetch_root (struct transbox *box, void *cookie, if (err) ret = MACH_PORT_NULL; - mach_port_destroy (mach_task_self (), rend); + mach_port_mod_refs (mach_task_self (), rend, MACH_PORT_RIGHT_RECEIVE, -1); return ret; } diff --git a/libshouldbeinlibc/exec-reauth.c b/libshouldbeinlibc/exec-reauth.c index fa4aa59e..263b1408 100644 --- a/libshouldbeinlibc/exec-reauth.c +++ b/libshouldbeinlibc/exec-reauth.c @@ -59,7 +59,7 @@ exec_reauth (auth_t auth, int secure, int must_reauth, if (!err) err = auth_user_authenticate (auth, ref, MACH_MSG_TYPE_MAKE_SEND, &newport); - mach_port_destroy (mach_task_self (), ref); + mach_port_mod_refs (mach_task_self (), ref, MACH_PORT_RIGHT_RECEIVE, -1); if (err) { if (must_reauth) |