aboutsummaryrefslogtreecommitdiff
path: root/libfshelp
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2021-06-09 15:41:58 +0300
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-08-10 22:17:08 +0200
commit5710aaa670a14cbbe4da0e8fe64314a55f14a015 (patch)
tree5a76113134f56b3e481c8019684fc1300d9e5d3f /libfshelp
parentb6c6e41a0d94740f4ecce9afdafa0c17348ce4c0 (diff)
downloadhurd-5710aaa670a14cbbe4da0e8fe64314a55f14a015.tar.gz
hurd-5710aaa670a14cbbe4da0e8fe64314a55f14a015.tar.bz2
hurd-5710aaa670a14cbbe4da0e8fe64314a55f14a015.zip
Make proc_reauthenticate () recreate proc port
And add proc_complete_reauthentication ()
Diffstat (limited to 'libfshelp')
-rw-r--r--libfshelp/start-translator-long.c16
1 files changed, 13 insertions, 3 deletions
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;