wahern / cqueues

Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua on Unix.
http://25thandclement.com/~william/projects/cqueues.html
MIT License
250 stars 37 forks source link

so_dial under-allocates for long paths #148

Open daurnimator opened 8 years ago

daurnimator commented 8 years ago
require"cqueues.socket".connect({path="/a/really/long/path/bigger/than/a/sockaddr_storage/"..("a"):rep(200)})
daurnimator commented 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?

daurnimator commented 8 years ago

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

wahern commented 8 years ago

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).