AF_LOCAL support in getnameinfo
Florian Weimer
fweimer@redhat.com
Wed Mar 9 16:08:00 GMT 2016
It turns out that for some reason, our getnameinfo implementation has
rudimentary support for AF_LOCAL. It is incomplete on Linux because it
does not properly handle names in the abstract namespace (which is
outside the file system), and does not handle overlong paths. The
mapping from socket addresses to a host name/service pair is also rather
ad hoc: the host name is the system host name, and the service is the
(potentially relative) path in the socket address.
getaddrinfo does not support AF_LOCAL, and cannot support it with
AF_UNSPEC at least, for security reasons:
<https://sourceware.org/ml/libc-help/2015-08/msg00012.html>
We could add getaddrinfo support for AF_LOCAL if it is explicitly
requested with an AF_LOCAL hint, but I'm not sure how useful it would be
in practice. Constructing a struct sockaddr * this way would not be
easier than building the socket address directly (even for overlong paths).
I'm leaning towards removal of the AF_LOCAL support from getnameinfo.
Comments?
Thanks,
Florian
More information about the Libc-alpha
mailing list