From 11b4ed1bced4e07dac02ec291c65ef4f4de5c01b Mon Sep 17 00:00:00 2001 From: Carl Fredrik Hammar Date: Mon, 2 Jul 2012 20:58:38 +0200 Subject: Check for rendezvous port death in auth server * auth/auth.c (S_auth_user_authenticate, S_auth_server_authenticate): Return EINVAL if rendezvous port dies during transaction. --- auth/auth.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'auth/auth.c') diff --git a/auth/auth.c b/auth/auth.c index ec738ce2..ba02b963 100644 --- a/auth/auth.c +++ b/auth/auth.c @@ -342,7 +342,11 @@ S_auth_user_authenticate (struct authhandle *userauth, /* We were interrupted; remove our record. */ { hurd_ihash_locp_remove (&pending_users, u.locp); - err = EINTR; + + /* Was it a normal interruption or did RENDEZVOUS die? */ + mach_port_type_t type; + mach_port_type (mach_task_self (), rendezvous, &type); + err = type & MACH_PORT_TYPE_DEAD_NAME ? EINVAL : EINTR; } mutex_unlock (&pending_lock); @@ -403,7 +407,11 @@ S_auth_server_authenticate (struct authhandle *serverauth, /* We were interrupted; remove our record. */ { hurd_ihash_locp_remove (&pending_servers, s.locp); - err = EINTR; + + /* Was it a normal interruption or did RENDEZVOUS die? */ + mach_port_type_t type; + mach_port_type (mach_task_self (), rendezvous, &type); + err = type & MACH_PORT_TYPE_DEAD_NAME ? EINVAL : EINTR; } else { -- cgit v1.2.3