Skip to content

Add support for abstract sockets#176

Merged
notgull merged 5 commits intomasterfrom
notgull/abstract-sock
Dec 7, 2023
Merged

Add support for abstract sockets#176
notgull merged 5 commits intomasterfrom
notgull/abstract-sock

Conversation

@notgull
Copy link
Copy Markdown
Contributor

@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 z-galaxy/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 z-galaxy/zbus#517

Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: John Nunley <dev@notgull.net>
Signed-off-by: John Nunley <dev@notgull.net>
Copy link
Copy Markdown
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 <dev@notgull.net>
@notgull
Copy link
Copy Markdown
Contributor 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 <dev@notgull.net>
Copy link
Copy Markdown
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
@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