Message341971
thanks, your code example zero-pads the socket address, and looking at the socketmodule.c code it does some padding under certain circumstances.
https://github.com/python/cpython/blob/master/Modules/socketmodule.c#L1318-L1330
The Unix man page specify the same requirement you've noticed:
When binding a socket to a pathname, a few rules should be observed
for maximum portability and ease of coding:
* The pathname in sun_path should be null-terminated.
* The length of the pathname, including the terminating null byte,
should not exceed the size of sun_path.
* The addrlen argument that describes the enclosing sockaddr_un
structure should have a value of at least:
offsetof(struct sockaddr_un, sun_path)+strlen(addr.sun_path)+1
or, more simply, addrlen can be specified as sizeof(struct sock‐
addr_un). |
|
Date |
User |
Action |
Args |
2019-05-09 07:49:58 | anthonypjshaw | set | recipients:
+ anthonypjshaw, pitrou, soutys |
2019-05-09 07:49:58 | anthonypjshaw | set | messageid: <1557388198.09.0.89715156134.issue25541@roundup.psfhosted.org> |
2019-05-09 07:49:58 | anthonypjshaw | link | issue25541 messages |
2019-05-09 07:49:57 | anthonypjshaw | create | |
|