Skip to content
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

Add support for abstract sockets #176

Merged
merged 5 commits into from
Dec 7, 2023
Merged

Add support for abstract sockets #176

merged 5 commits into from
Dec 7, 2023

Conversation

notgull
Copy link
Member

@notgull notgull commented Dec 6, 2023

In #146, I introduced a bug that prevented abstract sockets from
working. I passed the path straight into
rustix::net::SocketAddrUnix::new, which fails if it receives an abstract
socket.

This commit fixes this issue by explicitly checking for abstract
sockets. If it sees that the path it's receiving is abstract, it will
pass the path's bytes to new_abstract_socket() instead.

This should fix the issue that is occurring in dbus2/zbus#517

In #146, I introduced a bug that prevented abstract sockets from
working. I passed the path straight into
rustix::net::SocketAddrUnix::new, which fails if it receives an abstract
socket.

This commit fixes this issue by explicitly checking for abstract
sockets. If it sees that the path it's receiving is abstract, it will
pass the path's bytes to new_abstract_socket() instead.

This should fix the issue that is occurring in dbus2/zbus#517

Signed-off-by: John Nunley <[email protected]>
Signed-off-by: John Nunley <[email protected]>
Copy link
Member

@zeenix zeenix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks so much for looking into this. Would be great to have a test case for abstract sockets btw.

Signed-off-by: John Nunley <[email protected]>
@notgull
Copy link
Member Author

notgull commented Dec 7, 2023

LGTM. Thanks so much for looking into this. Would be great to have a test case for abstract sockets btw.

Added a test, and in the process found a bug that I'd missed.

@notgull notgull requested a review from zeenix December 7, 2023 01:23
Signed-off-by: John Nunley <[email protected]>
Copy link
Member

@zeenix zeenix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@notgull notgull merged commit cd7a868 into master Dec 7, 2023
21 checks passed
@notgull notgull deleted the notgull/abstract-sock branch December 7, 2023 13:52
@notgull notgull mentioned this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants