On Mon Jun 19 20:38:57 2023 +0000, Zebediah Figura wrote:
It does mean that sockaddr_to_unix() and sockaddr_from_unix() can't be used for AF_UNIX sockets, at least not with their current design. That may mean we should:
- change the function signature (always allocate instead of filling a
fixed-size sockaddr union?)
- or handle AF_UNIX specially (like the way this patch set handles
bind() and connect() specially)
- or just leave off sockaddr conversion in some functions for now—so
mark sendto() and recvfrom() as FIXME cases like getpeername().
Handling AF_UNIX specially, i.e. doing path translation somewhere near the call when necessary (as with `bind()` and `connect()`, seems the simplest, since adding a parameter would require significant refactoring. The only implementation of these functions that's actually called for AF_UNIX sockets is wineserver's, which does not have the path translation function this patch uses (`wine_get_unix_file_name()`, implemented in kernel32).
`sendto()` and `recvfrom()` are not currently special-cased for AF_UNIX sockets, and they work correctly. They flow to the same functions as `send()` and `recv()` respectively, specifically `WS2_sendto()` and `WS2_recv_base()`.