-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
GH-135357: Add SO_PASSRIGHTS constant #135355
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
base: main
Are you sure you want to change the base?
Conversation
Introduced in the linux kernel here[1] [1] https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1b98f357dadd
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference.
This will need a blurb (which requires an issue) and you need to sign the CLA.
And now CLA is failing? |
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Misc/NEWS.d/next/Core_and_Builtins/2025-06-10-17-30-55.gh-issue-135357.sUXU1W.rst
Outdated
Show resolved
Hide resolved
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm generally not a fan of just copying random flags that were recently added in Linux over to the standard library. This flag was added a mere 3 weeks ago, and seems to be incredibly low-level.
Does anyone know what it actually does, or what use case it has in Python?
https://lwn.net/Articles/1023085/ describes SO_PASSRIGHTS:
|
Oh, Linux 6.16 hasn't even released yet. We've rejected adding recent Linux flags in the past, and I think that should apply here too; let's wait until there's an actual desire for it before adding it to the standard library. |
Yes I know what the flag does and I was planning on using it. Also linux kernels and python release schedules do not match, and linux is faster. Anyway do as you please. |
It's a security flag for unix sockets. https://lwn.net/Articles/1023085/ |
I'm not opposed to adding it in general, I just don't want to right now, because it won't actually be on any Linux systems for a couple more months. We have until May of next year to get this in, and even longer before 3.15.0 gets released, so there's no rush here. It would also help if you could provide a concrete example of how this would be used in Python code. That's not too clear to me at the moment. |
It would be used by a normal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm marking this as DO-NOT-MERGE
for now. The actual changes look good, but my concern is that basically nobody supports or uses this flag (yet), because it's only in an unreleased Linux version. Let's come back to this in a few months. Thanks!
@@ -0,0 +1 @@ | |||
Add support for :data:`!socket.SO_PASSRIGHTS` on linux. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add support for :data:`!socket.SO_PASSRIGHTS` on linux. | |
Add support for :data:`!socket.SO_PASSRIGHTS` on Linux. |
This adds the newly introduced SO_PASSRIGHT constant to the socket module.
📚 Documentation preview 📚: https://cpython-previews--135355.org.readthedocs.build/