[issue25541] Wrong usage of sockaddr_un struct for abstract namespace unix sockets

PrzemeK report at bugs.python.org
Tue May 7 02:59:38 EDT 2019


PrzemeK <soutys at o2.pl> added the comment:

Gist: https://gist.github.com/soutys/ffbe2e76a86835a9cc6b

More:

Padding `sun_path` with zeros for python cli code:
 
...
client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
client.connect("\0/var/tmp/sock.tmp" + "\0" * 90)
...

gives strace like:
...
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
connect(3, {sa_family=AF_UNIX, sun_path=@"/var/tmp/sock.tmp\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 110) = 0
write(1, "Ready.\n", 7Ready.
)                 = 7
...

= works

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue25541>
_______________________________________


More information about the Python-bugs-list mailing list