summaryrefslogtreecommitdiff
path: root/debian/patches/libdiskfs_self-reauth.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/libdiskfs_self-reauth.patch')
-rw-r--r--debian/patches/libdiskfs_self-reauth.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/debian/patches/libdiskfs_self-reauth.patch b/debian/patches/libdiskfs_self-reauth.patch
new file mode 100644
index 00000000..c9650864
--- /dev/null
+++ b/debian/patches/libdiskfs_self-reauth.patch
@@ -0,0 +1,35 @@
+"RPC to self with rendez-vous leading to duplicate port destroy"
+
+http://lists.gnu.org/archive/html/bug-hurd/2011-03/msg00045.html
+
+I believe this shouldn't pose problem except a possible port leak in case port
+accounting is not correct somewhere.
+
+diff --git a/libfshelp/fetch-root.c b/libfshelp/fetch-root.c
+index 54d3c0c..6585052 100644
+--- a/libfshelp/fetch-root.c
++++ b/libfshelp/fetch-root.c
+@@ -79,7 +79,9 @@ fshelp_fetch_root (struct transbox *box, void *cookie,
+ if (err)
+ ret = MACH_PORT_NULL;
+
+- mach_port_destroy (mach_task_self (), rend);
++ /* crdir could be ourselves, and thus diskfs_S_io_reauthenticate
++ * would get the same name, so don't _destroy_ it !! */
++ mach_port_deallocate (mach_task_self (), rend);
+
+ return ret;
+ }
+diff --git a/libshouldbeinlibc/exec-reauth.c b/libshouldbeinlibc/exec-reauth.c
+index dd267ef..12b34fc 100644
+--- a/libshouldbeinlibc/exec-reauth.c
++++ b/libshouldbeinlibc/exec-reauth.c
+@@ -59,7 +59,7 @@ exec_reauth (auth_t auth, int secure, int must_reauth,
+ if (!err)
+ err = auth_user_authenticate (auth, ref, MACH_MSG_TYPE_MAKE_SEND,
+ &newport);
+- mach_port_destroy (mach_task_self (), ref);
++ mach_port_deallocate (mach_task_self (), ref);
+ if (err)
+ {
+ if (must_reauth)