Re: connect() access bytes after socket address

2013-03-01 Thread Roland McGrath
Could be. I need to see the full patch changing all the cases to give a real opinion about the details.

Re: connect() access bytes after socket address

2013-03-01 Thread Samuel Thibault
Samuel Thibault, le Fri 01 Mar 2013 19:17:56 +0100, a écrit : > Roland McGrath, le Fri 01 Mar 2013 09:57:11 -0800, a écrit : > > > I didn't bother, but I can indeed, probably to > > > glibc/include/sys/socket.h, or some other file? > > > > It's only needed for Hurd, so but it in some non-installed

Re: connect() access bytes after socket address

2013-03-01 Thread Samuel Thibault
Roland McGrath, le Fri 01 Mar 2013 09:57:11 -0800, a écrit : > > I didn't bother, but I can indeed, probably to > > glibc/include/sys/socket.h, or some other file? > > It's only needed for Hurd, so but it in some non-installed Hurd-only header. So for instance: #define _hurd_sun_path_dupa(__addr

Re: connect() access bytes after socket address

2013-03-01 Thread Roland McGrath
> I didn't bother, but I can indeed, probably to > glibc/include/sys/socket.h, or some other file? It's only needed for Hurd, so but it in some non-installed Hurd-only header. > > (or perhaps it needs to be macro declaring a local VLA) > > I rather used strndupa, provided by glibc/include/string

Re: connect() access bytes after socket address

2013-03-01 Thread Samuel Thibault
Roland McGrath, le Fri 01 Mar 2013 09:39:17 -0800, a écrit : > > I agree. I've worked on a patch, pushed to topgit for later submission. > > I hope you did it by adding a common helper function I didn't bother, but I can indeed, probably to glibc/include/sys/socket.h, or some other file? > (or p

Re: connect() access bytes after socket address

2013-03-01 Thread Roland McGrath
> I agree. I've worked on a patch, pushed to topgit for later submission. I hope you did it by adding a common helper function (or perhaps it needs to be macro declaring a local VLA) for at least the cases other than bind. bind needs to be a little different since it needs to do a split, but still

Re: connect() access bytes after socket address

2013-02-28 Thread Samuel Thibault
Tanaka Akira, le Thu 28 Feb 2013 15:35:07 +0900, a écrit : > 2013/2/28 Roland McGrath : > > I agree they should be consistent. Note that sendto and sendmsg are > > consistent with connect, rather than with bind. > > I didn't know that. > But I still think that the bind() behavior is better. > >

Re: connect() access bytes after socket address

2013-02-27 Thread Tanaka Akira
2013/2/28 Roland McGrath : > I agree they should be consistent. Note that sendto and sendmsg are > consistent with connect, rather than with bind. I didn't know that. But I still think that the bind() behavior is better. Giving the length without NUL is traditional practice in applications. Chan

Re: connect() access bytes after socket address

2013-02-27 Thread Roland McGrath
I agree they should be consistent. Note that sendto and sendmsg are consistent with connect, rather than with bind.