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

SourceForge.net noreply at sourceforge.net
Thu Apr 13 06:09:59 CEST 2006


Patches item #1062014, was opened at 2004-11-07 10:18
Message generated for change (Comment added) made by nnorwitz
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: Neal Norwitz (nnorwitz)
Date: 2006-04-12 21:09

Message:
Logged In: YES 
user_id=33168

Armin, do you want someone to review this?  Is it
small/straightforward enough that it could be checked in? 
Just trying to figure out if there's anything I should do.

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

Comment By: Armin Rigo (arigo)
Date: 2006-04-12 06:19

Message:
Logged In: YES 
user_id=4771

Added "#ifdef linux" in my patch, following the idea from
the original patch.

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

Comment By: Armin Rigo (arigo)
Date: 2006-04-12 05: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 03: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 12: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