From 62e1d54313a88457b281d85e8ab6a2559192f680 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 7 Jun 2018 17:33:34 +0100 Subject: [PATCH] fishdescriptor: Work if child is not running as root, but we are We make a socket, normally in /var/run/user for the victim process, which is therefore accessible only to the victim uid (and to root). If we are running as root, the socket will typically not be writeable by the user, and this will fail. We need to chmod it. Signed-off-by: Ian Jackson --- fishdescriptor/py/fishdescriptor/fish.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fishdescriptor/py/fishdescriptor/fish.py b/fishdescriptor/py/fishdescriptor/fish.py index 0f180bc..b47ac3d 100644 --- a/fishdescriptor/py/fishdescriptor/fish.py +++ b/fishdescriptor/py/fishdescriptor/fish.py @@ -154,6 +154,7 @@ class Donor(): s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) s.bind(our_sockname) + os.chmod(our_sockname, 666) s.listen(1) ancil_len = d.donate(our_sockname, fds) -- 2.30.2