gh-135815: skip `netrc` security checks if `os.getuid` is missing by picnixz · Pull Request #135816 · python/cpython · GitHub
Skip to content

gh-135815: skip netrc security checks if os.getuid is missing - #135816

Merged
picnixz merged 2 commits into
python:mainfrom
picnixz:fix/netrc/wasi-security-check-135815
Jun 22, 2025
Merged

gh-135815: skip netrc security checks if os.getuid is missing#135816
picnixz merged 2 commits into
python:mainfrom
picnixz:fix/netrc/wasi-security-check-135815

Conversation

@picnixz

@picnixz picnixz commented Jun 22, 2025

Copy link
Copy Markdown
Member

@picnixz
picnixz force-pushed the fix/netrc/wasi-security-check-135815 branch from c472cc9 to d2a13f6 Compare June 22, 2025 14:34
@picnixz picnixz added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jun 22, 2025
@python python deleted a comment from bedevere-bot Jun 22, 2025
@picnixz
picnixz requested a review from serhiy-storchaka June 22, 2025 15:06

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM.

Added a couple of suggestions, it is up to you.

Comment thread Lib/netrc.py Outdated
Comment thread Lib/netrc.py
Comment on lines 164 to 165

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The message looks weird. Would not be better to rewrite in in the following way?

                    (f"~/.netrc file owner ({fowner}) does not match"
                     f" current user ({user})"))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll change it in a follow-up PR so that only unstable branches are affected.

@picnixz
picnixz enabled auto-merge (squash) June 22, 2025 19:31
@picnixz
picnixz merged commit b57b619 into python:main Jun 22, 2025
@miss-islington-app

Copy link
Copy Markdown

Thanks @picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 22, 2025
…ng (pythonGH-135816)

(cherry picked from commit b57b619)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Jun 22, 2025

Copy link
Copy Markdown

GH-135825 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jun 22, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 22, 2025
…ng (pythonGH-135816)

(cherry picked from commit b57b619)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-app

bedevere-app Bot commented Jun 22, 2025

Copy link
Copy Markdown

GH-135826 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jun 22, 2025
@picnixz
picnixz deleted the fix/netrc/wasi-security-check-135815 branch June 22, 2025 19:49
picnixz added a commit that referenced this pull request Jun 22, 2025
…ing (GH-135816) (#135826)

gh-135815: skip `netrc` security checks if `os.getuid` is missing (GH-135816)
(cherry picked from commit b57b619)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz added a commit that referenced this pull request Jun 22, 2025
…ing (GH-135816) (#135825)

gh-135815: skip `netrc` security checks if `os.getuid` is missing (GH-135816)
(cherry picked from commit b57b619)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@bedevere-bot

Copy link
Copy Markdown

hoodmane added a commit to hoodmane/cpython that referenced this pull request Jul 3, 2025
Before python#135816 it was skipped because pwd is missing on Emscripten.
Now it isn't skipped because the test no longer requires pwd but it
still doesn't work on Emscripten.
AndPuQing pushed a commit to AndPuQing/cpython that referenced this pull request Jul 11, 2025
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants