login
Header Space

 
 

Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: David Miller <davem@...>
Cc: <linux-kernel@...>, <akpm@...>
Date: Monday, March 24, 2008 - 6:43 am

David Miller, le Sun 23 Mar 2008 21:56:41 -0700, a écrit :

Mmm, where that is documented?

I can't find any details about that in SUS, and man 7 unix says

`If sun_path starts with a null byte ('' '), then it refers to the
abstract namespace main- tained by the Unix protocol module.'

It doesn't talk about the size being only sizeof(short) (which I guess
you meant sizeof(sa_family_t) actually).


See documentation above.  If applications don't follow documentation,
then they deserve breaking :)

Note also that on some (BSD-ish) systems, sockaddr_un contains a sun_len
field, containing the length of the data, and thus on them accept and
getpeername return more that sizeof(sa_family_t) as length (it actually
returns 16).  So such applications are really broken.

Samuel
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Samuel Thibault, (Fri Mar 7, 10:23 pm)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, David Miller, (Mon Mar 24, 12:56 am)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Samuel Thibault, (Mon Mar 24, 6:43 am)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, David Miller, (Mon Mar 24, 4:23 pm)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Andi Kleen, (Mon Mar 24, 7:50 am)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Samuel Thibault, (Mon Mar 24, 8:17 am)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Samuel Thibault, (Mon Mar 24, 8:27 am)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Michael Kerrisk, (Mon Mar 31, 12:00 am)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Michael Kerrisk, (Fri Apr 18, 12:52 pm)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Samuel Thibault, (Wed Apr 23, 8:16 pm)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Michael Kerrisk, (Thu Apr 24, 4:31 am)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Samuel Thibault, (Fri Apr 25, 9:44 pm)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, David Miller, (Sun Apr 27, 1:54 am)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Michael Kerrisk, (Mon May 12, 9:10 am)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Samuel Thibault, (Mon May 12, 9:20 am)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Samuel Thibault, (Mon Mar 31, 5:44 am)
Re: [PATCH,TRIVIAL] AF_UNIX, accept() and addrlen, Michael Kerrisk, (Mon Mar 31, 2:51 pm)
speck-geostationary