Hi,

Liliana Marie Prikler <liliana.prik...@gmail.com> skribis:

> The current socket address constructors all assume, that there are no
> null bytes in the socket path.  This assumption does not hold in Linux,
> which uses an initial null byte to demarcate abstract sockets and
> ignores all further null bytes [1].
>
> [1] https://www.man7.org/linux/man-pages/man7/unix.7.html
>
> * libguile/sockets.c (scm_fill_sockaddr)[HAVE_UNIX_DOMAIN_SOCKETS]:
> Use scm_to_locale_stringn to construct c_address.
> Use memcpy instead of strcpy and calculate size directly instead of
> using SUN_LEN.
> (_scm_from_sockaddr): Copy the entire path up to the limits imposed by
> addr_size.
> * test-suite/tests/00-socket.test: ("make-socket-address"): Add case for
> abstract unix sockets.
> ("AF_UNIX/SOCK_STREAM"): Add abstract socket versions of bind, listen,
> connect and accept.

Finally applied, thanks!

Ludo’.



Reply via email to