[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#53928: [PATCH] Allow null bytes in UNIX sockets.

From: Ludovic Courtès
Subject: bug#53928: [PATCH] Allow null bytes in UNIX sockets.
Date: Thu, 16 Jun 2022 10:09:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)


Liliana Marie Prikler <liliana.prikler@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!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]