This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

AF_LOCAL support in getnameinfo


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]