-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Set permissions/ownership when creating a socket #94984
Comments
Can't you do this by calling |
Yes, see the original (archived) issue linked. The behaviour is not desirable, and could potentially lead to security issues. If you can create a file with the correct permissions, why would you not be able to create a named socket with the correct permissions? e.g. os.open allows setting the permissions on creation: https://docs.python.org/3/library/os.html#os.open |
Possibly because there's no platform-independent way to do it? (I think I gleaned this from the original issue.) Anyway, I'd be happy to review a PR, but I'm not the expert here. @Dreamsorcerer are you interested in submitting a PR? |
Not currently, got a hundred things to catch up on with aiohttp etc. Mainly just wanted to make sure the request didn't get lost. Maybe I'll get some time to come back to it at some point though. |
No worries, hopefully someone else with relevant knowledge will help us out. |
Feature or enhancement
When creating a socket with one of the asyncio methods, it should be possible to specify the correct ownership/permissions needed for good security.
Pitch
When creating a server with
loop.create_unix_server()
, it will create the socket with default permissions which may lack security or may not be accessible to the application that is meant to communicate via this socket.Previous discussion
python/asyncio#426
The text was updated successfully, but these errors were encountered: