diff options
author | Carl Fredrik Hammar <hammy.lite@gmail.com> | 2012-07-02 20:58:38 +0200 |
---|---|---|
committer | Fredrik Hammar <carl.fredrik.hammar@gmail.com> | 2012-07-02 21:03:00 +0200 |
commit | 11b4ed1bced4e07dac02ec291c65ef4f4de5c01b (patch) | |
tree | 0f02cc9208d95a7c67f259dfd6862ec25ec5d1d0 | |
parent | 97ae4966e6e9d6d58102aaeb3e133fe7c5ff65da (diff) |
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.
-rw-r--r-- | auth/auth.c | 12 |
1 files changed, 10 insertions, 2 deletions
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 { |