chiark / gitweb /
fishdescriptor: Work if child is not running as root, but we are
[chiark-utils.git] / fishdescriptor / py / fishdescriptor / fish.py
index 56a562db6ce9c94a400e5b60eb1c226c59d36a37..b47ac3dbb6aeb493b56f86a33aed9ff1cbf72669 100644 (file)
@@ -1,3 +1,24 @@
+# fish.py
+
+# This file is part of chiark-utils, a collection of useful programs
+# used on chiark.greenend.org.uk.
+#
+# This file is:
+#  Copyright 2018 Citrix Systems Ltd
+#
+# This is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 3, or (at your option) any later version.
+#
+# This is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, consult the Free Software Foundation's
+# website at www.fsf.org, or the GNU Project website at www.gnu.org.
+
 # python 3 only
 
 import socket
@@ -133,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)