Ahh, I am partly being a goose. I kept reading that strlen() as sizeof()
when reading the manual page. :-(
Graham
On 1 June 2014 21:44, Jeff Trawick wrote:
> On Sun, Jun 1, 2014 at 3:10 AM, Graham Dumpleton
> wrote:
>
>> What I don't quite understand is why the Linux manual pages:
>>
>> htt
On Sun, Jun 1, 2014 at 7:44 AM, Jeff Trawick wrote:
> On Sun, Jun 1, 2014 at 3:10 AM, Graham Dumpleton
> wrote:
>
>> What I don't quite understand is why the Linux manual pages:
>>
>> http://man7.org/linux/man-pages/man7/unix.7.html
>>
>> are even promoting the style:
>>
>> offsetof(struct s
On Sun, Jun 1, 2014 at 3:10 AM, Graham Dumpleton wrote:
> What I don't quite understand is why the Linux manual pages:
>
> http://man7.org/linux/man-pages/man7/unix.7.html
>
> are even promoting the style:
>
> offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1
>
> That would produc
What I don't quite understand is why the Linux manual pages:
http://man7.org/linux/man-pages/man7/unix.7.html
are even promoting the style:
offsetof(struct sockaddr_un, sun_path) + strlen(sun_path) + 1
That would produce a length with is technically 1 greater than what the
size of sockaddr_
Fix in r1598946.
CJ
There is also the same kind of code in apr/misc/unix/rand.c.
In this case, the +1 is missing.
I think that line 157 of 'rand.c' should be changed in:
egd_path_len = strlen(*egdsockname) + 1;
in order to take into account the '\0' that is expedted at the end of
sun_path.
CJ
Le 31/05/2
Hi,
I share your feeling.
See line 2572 of proxy_util.c, where the length is computed as follow:
const socklen_t addrlen = APR_OFFSETOF(struct sockaddr_un,
sun_path)
+ strlen(sa->sun_path) + 1;
rv = connect(rawsock, (struct sockaddr*)sa, addrl
In mod_proxy_fdpass there is a function socket_connect_un():
https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/proxy/mod_proxy_fdpass.c
which contains the code:
rv = connect(rawsock, (struct sockaddr*)sa,
sizeof(*sa) + strlen(sa->sun_path));
Can