-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sendmsg fails with EINVAL when sending ScmRights over unconnected socket #884
Comments
sunfishcode
added a commit
that referenced
this issue
Oct 19, 2023
When encoding the address for `sendmsg_unix`, use the `unix` field of `SocketAddrUnix`, since the `unix` field is the `sockaddr_un` that the OS will read. Fixes #884.
Thanks for the report! This is a rustix bug; I've now filed #885 with a fix. |
sunfishcode
added a commit
that referenced
this issue
Oct 19, 2023
When encoding the address for `sendmsg_unix`, use the `unix` field of `SocketAddrUnix`, since the `unix` field is the `sockaddr_un` that the OS will read. Fixes #884.
sunfishcode
added a commit
that referenced
this issue
Oct 19, 2023
When encoding the address for `sendmsg_unix`, use the `unix` field of `SocketAddrUnix`, since the `unix` field is the `sockaddr_un` that the OS will read. Fixes #884.
sunfishcode
added a commit
that referenced
this issue
Oct 19, 2023
When encoding the address for `sendmsg_unix`, use the `unix` field of `SocketAddrUnix`, since the `unix` field is the `sockaddr_un` that the OS will read. Fixes #884.
Thank you very much 🙏 |
sunfishcode
added a commit
that referenced
this issue
Oct 19, 2023
When encoding the address for `sendmsg_unix`, use the `unix` field of `SocketAddrUnix`, since the `unix` field is the `sockaddr_un` that the OS will read. Fixes #884.
sunfishcode
added a commit
that referenced
this issue
Oct 19, 2023
When encoding the address for `sendmsg_unix`, use the `unix` field of `SocketAddrUnix`, since the `unix` field is the `sockaddr_un` that the OS will read. Fixes #884.
This is now released in rustix 0.38.20. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I can send a file descriptor over a connected unix socket just fine with the following code:
I can also send an FD over an unconnected socket with libc, see https://github.com/swsnr/rustix-sendfd/blob/86540a6d37ee8670c77f467ddde3d7430d22ccb8/src/lib.rs#L74 (too long to paste here).
However, doing that in rustix with the following code fails with
called Result::unwrap() on an Err value: Os { code: 22, kind: InvalidInput, message: "Invalid argument" }
atsendmsg_unix
:What did I do wrong here?
See https://github.com/swsnr/rustix-sendfd for a repo with three tests which reproduce this, and the corresponding workflow for the actual failure at https://github.com/swsnr/rustix-sendfd/actions/runs/6572703065/job/17854300669#step:4:33
The text was updated successfully, but these errors were encountered: