From 79dee035863a6967c1bb946c679f516bd9267b62 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 19 Nov 2018 16:08:57 +0000 Subject: [PATCH] fishdescriptor: Cope if donor is in a chroot without /proc `our_sockname' contains something like /proc/DONOR/root/run/user/UID/fishdescriptor/SOCKET When I tested this I did it in a chroot where /proc was mounted. In such a chroot /proc/DONOR/root -> /. So this works. But if there is no /proc, it does not work. Instead, we can can and should assume that the path in the donor is relative to its own root. Ie, we can just use `sockname'. CC: George Dunlap Signed-off-by: Ian Jackson --- fishdescriptor/py/fishdescriptor/fish.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fishdescriptor/py/fishdescriptor/fish.py b/fishdescriptor/py/fishdescriptor/fish.py index b47ac3d..9d2d3c6 100644 --- a/fishdescriptor/py/fishdescriptor/fish.py +++ b/fishdescriptor/py/fishdescriptor/fish.py @@ -157,7 +157,7 @@ class Donor(): os.chmod(our_sockname, 666) s.listen(1) - ancil_len = d.donate(our_sockname, fds) + ancil_len = d.donate(sockname, fds) (s2, dummy) = s.accept() (msg, ancil, flags, sender) = s2.recvmsg(1, ancil_len) -- 2.30.2