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

Pass correct path length for abstract sockets #430

Merged
merged 1 commit into from
May 24, 2024

Conversation

Zash
Copy link
Contributor

@Zash Zash commented Apr 27, 2024

Since they start with NUL byte, strlen() does the wrong thing. The Lua API can already pass the real string length, so passing that on seems the sensible thing to do.

Fixes #216

Copy link
Contributor Author

@Zash Zash left a comment

Choose a reason for hiding this comment

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

Pull request authors can’t request changes on their own pull request

Okay then!

src/unixdgram.c Outdated Show resolved Hide resolved
@Zash Zash marked this pull request as draft April 27, 2024 20:31
@Zash Zash marked this pull request as ready for review April 27, 2024 20:44
Since they start with NUL byte, strlen() does the wrong thing.
The Lua API can already pass the real string length, so passing that on
seems the sensible thing to do.

Fixes lunarmodules#216

Removes SUN_LEN macro in favor of the approach used in unixstream.c
since it does not depend on strlen(), which would not work with
NUL-prefixed abstract stream socket paths.
@Zash
Copy link
Contributor Author

Zash commented Apr 27, 2024

Sorry about that, now it actually works, not just seems to work because bind(sun_path="") succeeds but does something else.

@alerque alerque merged commit e3ca4a7 into lunarmodules:master May 24, 2024
19 checks passed
@Zash Zash deleted the unix-abstract branch May 24, 2024 13:19
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.

No support for abstract namespace?
2 participants