[issue12981] rewrite multiprocessing (senfd|recvfd) in Python

Charles-François Natali report at bugs.python.org
Sun Sep 18 23:11:40 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

> I had a look at this patch, and the FD passing looked OK, except
> that calculating the buffer size with CMSG_SPACE() may allow more
> than one file descriptor to be received, with the extra one going
> unnoticed - it should use CMSG_LEN() instead

Thanks for catching this.
Here's an updated patch.

> (the existing C implementation has the same problem, I see).

I just checked, and the C version uses CMSG_SPACE() as the buffer size, but passes CMSG_LEN() to cmsg->cmsg_len and msg.msg_controllen. Or am I missing something?

----------
Added file: http://bugs.python.org/file23189/multiprocessing_fd-3.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12981>
_______________________________________


More information about the Python-bugs-list mailing list