You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That's deliberate. Such a method could be implemented on the BSDs. But Linux doesn't have a sun_len field, which means you can't cast a sockaddr_storage to a sockaddr_un without having some other source for information about its valid length.
Under linux, sockaddr_un does not have a length field, but the nix Rust
wrapper for it does keep track of the length, and this must be managed
correctly or else UnixAddr::path() will return strings that are too
long. Without this change I get either:
Error: Failed to listen on /var/lib/erbium/control<binary garbage>:
path must be shorter than libc::sockaddr_un.sun_path
or
Error: Failed to cleanup /var/lib/erbium/control: file name contained
an unexpected NUL byte
Prior to the resolution of nix-rust/nix#1800
passing the maximum size of a sockaddr_un path was probably the right
thing to do, but now it seems it is no longer correct, and furthermore
there is now a .as_unix_addr() method on SockaddrStorage.
As above, there's no
.as_unix_addr()
/.as_unix_addr_mut()
methods on SockaddrStorage.Comparing the list from https://docs.rs/nix/latest/nix/sys/socket/trait.SockaddrLike.html#implementors to https://docs.rs/nix/latest/nix/sys/socket/union.SockaddrStorage.html#implementations :
The text was updated successfully, but these errors were encountered: