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

create_unix_listener doesn't accept abstract namespace sockets #781

Closed
2 tasks done
tapetersen opened this issue Sep 4, 2024 · 0 comments · Fixed by #782
Closed
2 tasks done

create_unix_listener doesn't accept abstract namespace sockets #781

tapetersen opened this issue Sep 4, 2024 · 0 comments · Fixed by #782
Labels
bug Something isn't working

Comments

@tapetersen
Copy link
Contributor

Things to check first

  • I have searched the existing issues and didn't find my bug already reported there

  • I have checked that my bug is still present in the latest release

AnyIO version

4.4.0

Python version

3.10

What happened?

On anyio version 3.7 at least it's possible to pass a path starting with a null byte to anyio.create_unix_listener to create an abstract unix domain socket that isn't backed by a real file and is cleaned up automatically on program close.

In version 4.4.0 (at least probably earlier) this gives a ValueError: embedded null byte when the code tries to call os.stat on the path.

How can we reproduce the bug?

import anyio
anyio.run(anyio.create_unix_listener, '\0abstract-path')

I havn't tested on trio backend or more versions but may do so later.
Assuming this is something that is desired to fix I may try creating a PR for it as well.

@tapetersen tapetersen added the bug Something isn't working label Sep 4, 2024
tapetersen added a commit to tapetersen/anyio that referenced this issue Sep 4, 2024
Accept paths starting with a null byte in create_unix_listener and
connect_unix_socket to allow creating abstract unix sockets. Fixes agronholm#781
tapetersen added a commit to tapetersen/anyio that referenced this issue Sep 4, 2024
Accept paths starting with a null byte in create_unix_listener and
connect_unix_socket to allow creating abstract unix sockets. Fixes agronholm#781
tapetersen added a commit to tapetersen/anyio that referenced this issue Sep 5, 2024
Accept paths starting with a null byte in create_unix_listener and
connect_unix_socket to allow creating abstract unix sockets. Fixes agronholm#781
tapetersen added a commit to tapetersen/anyio that referenced this issue Sep 5, 2024
Accept paths starting with a null byte in create_unix_listener and
connect_unix_socket to allow creating abstract unix sockets. Fixes agronholm#781
tapetersen added a commit to tapetersen/anyio that referenced this issue Sep 5, 2024
Accept paths starting with a null byte in create_unix_listener and
connect_unix_socket to allow creating abstract unix sockets. Fixes agronholm#781
tapetersen added a commit to tapetersen/anyio that referenced this issue Sep 5, 2024
Accept paths starting with a null byte in create_unix_listener and
connect_unix_socket to allow creating abstract unix sockets. Fixes agronholm#781
agronholm pushed a commit that referenced this issue Sep 5, 2024
Accept paths starting with a null byte in create_unix_listener() and connect_unix_socket() to allow creating abstract UNIX sockets. Fixes #781.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant