This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
AF_LOCAL support in getnameinfo
- From: Florian Weimer <fweimer at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 9 Mar 2016 17:08:08 +0100
- Subject: AF_LOCAL support in getnameinfo
- Authentication-results: sourceware.org; auth=none
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