PrzemeK added the comment:
Yep, it was 3.4 then... but I think problem still exists
tl;dr: For abstract sockets (only?) filling struct with zeros is
meaningful.
long:
* Python (cli) -> Python (srv) = works
* C (cli) -> C (srv) = works
* C (cli) -> Python (srv) = does NOT work
* Py
PrzemeK 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 str
Changes by PrzemeK :
--
components: IO, Library (Lib)
nosy: soutys
priority: normal
severity: normal
status: open
title: Wrong usage of sockaddr_un struct for abstract namespace unix sockets
type: behavior
versions: Python 2.7, Python 3.4
___
Python
New submission from PrzemeK:
Case:
http://stackoverflow.com/questions/33465094/connection-refused-when-using-abstract-namespace-unix-sockets
The code that does not work (python3 example):
...
sock_path = b"/var/tmp/sock.tmp"
server.bind(b"\0" + sock_path)
...
and str
PrzemeK added the comment:
Errata - 1st paragraph should be:
The code that does not work (python3 example):
...
sock_path = b"/var/tmp/sock.tmp"
server.bind(b"\0" + sock_path)
...
and strace shows:
bind(3, {sa_family=AF_LOCAL, sun_path=@"/var/t