Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-144023: prevent follow_symlinks from being allowed with an fd of 0#144022
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
5e70bef tob253e1eCompare
sobolevn left a comment
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.
Is there any way to test this?
vstinner commentedJan 19, 2026
Current behavior: |
…d of 0fd_and_follow_symlinks_invalid lets you use fd and follow_symlinks together if fd is 0.This is incorrect, as 0 is a valid fd.
SiliconA-Z commentedJan 19, 2026
Thank you! |
serhiy-storchaka left a comment
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.
Good catch. LGTM. 👍
sobolevn left a comment
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.
Thank you!
fa44efa intopython:mainUh oh!
There was an error while loading.Please reload this page.
Thanks @AZero13 for the PR, and@serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
Sorry, @AZero13 and@serhiy-storchaka, I could not cleanly backport this to |
Sorry,@AZero13 and@serhiy-storchaka, I could not cleanly backport this to |
…th an fd of 0 (pythonGH-144022)The check was (fd > 0), should be (fd >= 0).(cherry picked from commitfa44efa)Co-authored-by: AZero13 <gfunni234@gmail.com>
…th an fd of 0 (pythonGH-144022)The check was (fd > 0), should be (fd >= 0).(cherry picked from commitfa44efa)Co-authored-by: AZero13 <gfunni234@gmail.com>
GH-144151 is a backport of this pull request to the3.14 branch. |
…th an fd of 0 (pythonGH-144022)The check was (fd > 0), should be (fd >= 0).(cherry picked from commitfa44efa)Co-authored-by: AZero13 <gfunni234@gmail.com>
GH-144152 is a backport of this pull request to the3.13 branch. |
Uh oh!
There was an error while loading.Please reload this page.
fd_and_follow_symlinks_invalid lets you use fd and follow_symlinks together if fd is 0.
This is incorrect, as 0 is a valid fd.