Skip to content

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

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

Merged
merged 2 commits into from
Jun 22, 2025

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Jun 22, 2025

@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
Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

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 on lines 164 to 165
(f"~/.netrc file owner ({fowner}, {user}) does not match"
" current user"))
Copy link
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
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
40 checks passed
@miss-islington-app
Copy link

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
Copy link

bedevere-app bot commented Jun 22, 2025

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
Copy link

bedevere-app bot commented Jun 22, 2025

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

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot aarch64 Fedora Stable Refleaks 3.14 (tier-2) has failed when building commit 10f9db9.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/#/builders/1710/builds/192) and take a look at the build logs.
  4. Check if the failure is related to this commit (10f9db9) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/#/builders/1710/builds/192

Failed tests:

  • test_perf_profiler

Failed subtests:

  • test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated - test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated
  • test_timerfd_select - test.test_os.TimerfdTests.test_timerfd_select
  • test_python_calls_appear_in_the_stack_if_perf_activated - test.test_perf_profiler.TestPerfProfilerWithDwarf.test_python_calls_appear_in_the_stack_if_perf_activated

Summary of the results of the build (if available):

==

Click to see traceback logs
Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-aarch64.refleak/build/Lib/test/test_perf_profiler.py", line 399, in test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated
    self.assertEqual(stderr, "")
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
AssertionError: 'Warning:\nProcessed 403 events and lost 1[34 chars]\n\n' != ''
- Warning:
- Processed 403 events and lost 1 chunks!
- 
- Check IO/CPU overload!
- 


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-aarch64.refleak/build/Lib/test/test_perf_profiler.py", line 399, in test_python_calls_do_not_appear_in_the_stack_if_perf_deactivated
    self.assertEqual(stderr, "")
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
AssertionError: 'Warning:\nProcessed 429 events and lost 1[34 chars]\n\n' != ''
- Warning:
- Processed 429 events and lost 1 chunks!
- 
- Check IO/CPU overload!
- 


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-aarch64.refleak/build/Lib/test/test_perf_profiler.py", line 373, in test_python_calls_appear_in_the_stack_if_perf_activated
    self.assertEqual(stderr, "")
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
AssertionError: 'Warning:\nProcessed 653 events and lost 1[34 chars]\n\n' != ''
- Warning:
- Processed 653 events and lost 1 chunks!
- 
- Check IO/CPU overload!
- 


Traceback (most recent call last):
  File "/home/buildbot/buildarea/3.14.cstratak-fedora-stable-aarch64.refleak/build/Lib/test/test_os.py", line 4450, in test_timerfd_select
    self.assertEqual(self.read_count_signaled(fd), 1)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 2 != 1

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