From 5710aaa670a14cbbe4da0e8fe64314a55f14a015 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Wed, 9 Jun 2021 15:41:58 +0300 Subject: Make proc_reauthenticate () recreate proc port And add proc_complete_reauthentication () --- libfshelp/start-translator-long.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'libfshelp/start-translator-long.c') diff --git a/libfshelp/start-translator-long.c b/libfshelp/start-translator-long.c index 1bbf310a..e870767f 100644 --- a/libfshelp/start-translator-long.c +++ b/libfshelp/start-translator-long.c @@ -300,10 +300,20 @@ fshelp_start_translator_long (fshelp_open_fn_t underlying_open_fn, mach_port_mod_refs (mach_task_self (), rend, MACH_PORT_RIGHT_RECEIVE, -1); - } - if (err) - goto lose_task; + if (err) + goto lose_task; + + err = proc_complete_reauthentication (newport); + if (err) + { + mach_port_deallocate (mach_task_self (), newport); + goto lose_task; + } + + mach_port_deallocate (mach_task_self (), ports[INIT_PORT_PROC]); + ports[INIT_PORT_PROC] = newport; + } saveport = ports[INIT_PORT_BOOTSTRAP]; ports[INIT_PORT_BOOTSTRAP] = bootstrap; -- cgit v1.2.3