[Patches] [ python-Patches-1062014 ] fix for 764437 AF_UNIX socket special linux socket names

SourceForge.net noreply at sourceforge.net
Wed Apr 12 14:57:32 CEST 2006


Patches item #1062014, was opened at 2004-11-07 18:18
Message generated for change (Comment added) made by arigo
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1062014&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Modules
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Irmen de Jong (irmen)
Assigned to: Jeremy Hylton (jhylton)
Summary: fix for 764437 AF_UNIX socket special linux socket names

Initial Comment:
The patch addresses two things:
1. the socket name (obtained using getsockname() or
getpeername() ) will now be correct in case of the
special linux socket names (starting with 0 byte)
2. the socket module now has a new constant:
UNIX_PATH_MAX , that can be used to build
correctly-sized path names.


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

>Comment By: Armin Rigo (arigo)
Date: 2006-04-12 12:57

Message:
Logged In: YES 
user_id=4771

I have made an independent patch for this, based on another
interpretation of "man 7 unix": all the names in the Linux
abstract namespace don't have to be UNIX_PATH_MAX characters
long; instead, their length is remembered by the system and
available as 'addrlen', which is correctly passed around in
socketmodule.c.

The attached patch allows these special names of any length
to be set and read, and the length is preserved.  It does
not expose UNIX_PATH_MAX because it's not an essential
piece of information.  I've written a small test too.

I don't think the docs need updating for this patch, beyond
a mention in the NEWS file.

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

Comment By: Irmen de Jong (irmen)
Date: 2004-11-08 11:05

Message:
Logged In: YES 
user_id=129426

Not only does it need a new regression test, but if it is
accepted as-is, the socket module docs need to be updated
too (mention the new constant for use with the special
naming case)

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

Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-11-07 20:11

Message:
Logged In: YES 
user_id=469548

As you noted on IRC: this needs a new regression test.

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

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


More information about the Patches mailing list