Open daurnimator opened 8 years ago
I was going to fix this but then remembered #103.
Should we change the signature of so_dial
to take a socklen_t
?
Looking at linux's implementation (http://lxr.free-electrons.com/source/net/unix/af_unix.c) the kernel will ignore anything after 108 bytes.
In which case, I think we should throw an error if plen
is longer than UNIX_PATH_MAX
Some other implementations support longer paths. Last time I checked at least one supported paths substantially longer than sizeof .sun_path. May have been several implementations. I forget which one(s).
lso_connect2
only allocates asockaddr_un
: any extra characters are silently discardedso_dial
only allocates asockaddr_storage
(but uses a length ofsizeof (struct sockaddr_un)
viaaf_len
: ifsizeof sockaddr_storage >= sizeof sockaddr_un
then you get silent truncation)