From 9e6649f31e1769ca3b2545993ef51f2039848719 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 14 Feb 2016 20:29:11 +0100 Subject: Fix hang on reauthentication One needs to keep the port being reauthenticated alive until we are sure the server has complete authentication. * libfshelp/fetch-root.c (fshelp_fetch_root): Deallocate `port' after auth_user_authenticate has completed. * trans/fakeroot.c (netfs_S_dir_lookup): Likewise with `file'. --- libfshelp/fetch-root.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libfshelp') diff --git a/libfshelp/fetch-root.c b/libfshelp/fetch-root.c index 1b6739ec..d7761e58 100644 --- a/libfshelp/fetch-root.c +++ b/libfshelp/fetch-root.c @@ -75,10 +75,10 @@ fshelp_fetch_root (struct transbox *box, void *cookie, /* MAKE_SEND is safe here because we destroy REND ourselves. */ err = io_reauthenticate (port, rend, MACH_MSG_TYPE_MAKE_SEND); - mach_port_deallocate (mach_task_self (), port); if (! err) err = auth_user_authenticate (newauth, rend, MACH_MSG_TYPE_MAKE_SEND, &ret); + mach_port_deallocate (mach_task_self (), port); if (err) ret = MACH_PORT_NULL; -- cgit v1.2.3