[Python-bugs-list] [ python-Bugs-764437 ] AF_UNIX sockets do not handle Linux-specific addressing

SourceForge.net noreply@sourceforge.net
Wed, 02 Jul 2003 12:38:01 -0700


Bugs item #764437, was opened at 2003-07-02 02:13
Message generated for change (Settings changed) made by ppergame
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=764437&group_id=5470

Category: Python Library
>Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Paul Pergamenshchik (ppergame)
Assigned to: Nobody/Anonymous (nobody)
Summary: AF_UNIX sockets do not handle Linux-specific addressing

Initial Comment:
As described in unix(7) manpage, Linux allows for 
special "kernel namespace" AF_UNIX sockets defined. 
With such sockets, the first byte of the path is \x00, 
and the rest is the address. These sockets do not show 
up in the filesystem.
socketmodule.c:makesockaddr (as called by recvfrom) 
uses code like
PyString_FromString(a->sun_path)
to retrieve the address. This is incorrect -- on Linux, if 
the first byte of a->sun_path is null, the function should 
use PyString_FromStringAndSize to retrieve the full 108-
byte buffer.
I am not entirely sure that this is the only thing that 
needs to be fixed, but bind() and sendto() work with 
these sort of socket paths just fine.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=764437&group_id=5470