René's URL Explorer Experiment


Title: gh-152936: Make privileged functions available on Android by sabamdarif · Pull Request #152977 · python/cpython · GitHub

Open Graph Title: gh-152936: Make privileged functions available on Android by sabamdarif · Pull Request #152977 · python/cpython

X Title: gh-152936: Make privileged functions available on Android by sabamdarif · Pull Request #152977 · python/cpython

Description: os.chroot,initgroups,setegid,seteuid,setgid.... are currently blocked on Android. Because the underlying C functions crash the process when called by a non-root user on android, rather than returning an error. So i added getuid() != 0 check (under #ifdef __ANDROID__) before each call, so it will return PermissionError for non-root just like normal Unix Fixes #152936 Issue: gh-152936

Open Graph Description: os.chroot,initgroups,setegid,seteuid,setgid.... are currently blocked on Android. Because the underlying C functions crash the process when called by a non-root user on android, rather than returni...

X Description: os.chroot,initgroups,setegid,seteuid,setgid.... are currently blocked on Android. Because the underlying C functions crash the process when called by a non-root user on android, rather than returni...

Opengraph URL: https://github.com/python/cpython/pull/152977

X: @github

direct link

Domain: github.com

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:96ff87b1-645c-859d-c68e-77c5769902f3
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idCD38:FC5BE:36BDF4E:48B494B:6B02099B
html-safe-nonce9a424440e584380fdbbef0d3d23709d574b4c9044d6c923fc79db226be571452
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRDM4OkZDNUJFOjM2QkRGNEU6NDhCNDk0Qjo2QjAyMDk5QiIsInZpc2l0b3JfaWQiOiI4NjU2MDk2MDEzNzc5NjAxODE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacc80cc51b78ec1190057499d116d99598c486a69270324bf28626bf57e3927e45
hovercard-subject-tagpull_request:3988002040
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/152977/files
twitter:imagehttps://avatars.githubusercontent.com/u/111168803?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/111168803?s=400&v=4
og:image:altos.chroot,initgroups,setegid,seteuid,setgid.... are currently blocked on Android. Because the underlying C functions crash the process when called by a non-root user on android, rather than returni...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/152977/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F152977%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F152977%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/152977/files
Reloadhttps://github.com/python/cpython/pull/152977/files
Reloadhttps://github.com/python/cpython/pull/152977/files
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
freakboy3742https://github.com/freakboy3742
python:mainhttps://github.com/python/cpython/tree/main
sabamdarif:mainhttps://github.com/sabamdarif/cpython/tree/main
Conversation 34 https://github.com/python/cpython/pull/152977
Commits 9 https://github.com/python/cpython/pull/152977/commits
Checks 57 https://github.com/python/cpython/pull/152977/checks
Files changed https://github.com/python/cpython/pull/152977/files
Please reload this pagehttps://github.com/python/cpython/pull/152977/files
gh-152936: Make privileged functions available on Android https://github.com/python/cpython/pull/152977/files#top
Show all changes 9 commits https://github.com/python/cpython/pull/152977/files
8b77d9d gh-152936: Make privileged functions available on Android sabamdarif Jul 3, 2026 https://github.com/python/cpython/pull/152977/commits/8b77d9d1dbc027641f72784ef3e4067f1ea0f890
f7effcf 📜🤖 Added by blurb_it. blurb-it[bot] Jul 8, 2026 https://github.com/python/cpython/pull/152977/commits/f7effcf98d156a051f8570a94d5c2d416d8b6e5f
dd73903 gh-152936: Use posix_error for Android checks sabamdarif Jul 8, 2026 https://github.com/python/cpython/pull/152977/commits/dd73903ec567cdddecfd14d2c66fb03f8e37dbdd
27e854c gh-152936: Document Android support in os and socket sabamdarif Jul 8, 2026 https://github.com/python/cpython/pull/152977/commits/27e854c6038129ef8b8e7e6198092ca8b696d7ea
907676b gh-152936: Fix test_os and test_posix failures on Android sabamdarif Jul 11, 2026 https://github.com/python/cpython/pull/152977/commits/907676bfc06490e896e7a2a0ab7528ac34c5f691
16b633c gh-152936: Fix AttributeError for os.chroot on platforms without it sabamdarif Jul 11, 2026 https://github.com/python/cpython/pull/152977/commits/16b633ce71a0cc0b72886f24502a69e0524e078a
5bf2bcc Merge branch 'main' into sabamdarif-main mhsmith Aug 12, 2026 https://github.com/python/cpython/pull/152977/commits/5bf2bccef1c5ffecd687232b6d37f208f97f37dd
32d37aa Revert to including path in `chroot` error message mhsmith Aug 12, 2026 https://github.com/python/cpython/pull/152977/commits/32d37aada49f73ec786657a4e4714f38b6ad802f
d4df9df Merge remote-tracking branch 'origin/main' into sabamdarif-main mhsmith Sep 2, 2026 https://github.com/python/cpython/pull/152977/commits/d4df9df278af2727cf0316e7447e93d85302aa60
Clear filters https://github.com/python/cpython/pull/152977/files
Please reload this pagehttps://github.com/python/cpython/pull/152977/files
Please reload this pagehttps://github.com/python/cpython/pull/152977/files
os.rst https://github.com/python/cpython/pull/152977/files#diff-cd9132e5234678864807ae34a75c5d4d6b894b31c327a4d3620fbd0c37eec16e
socket.rst https://github.com/python/cpython/pull/152977/files#diff-e9e93d6b76a8a1cf0825d557b12e7ce3e67081cad650063eee520b81fd651943
3.16.rst https://github.com/python/cpython/pull/152977/files#diff-e69e0be717f3409832d520e20348f62af39c9436ba1a9d82e842bc10e5eb51d7
test_posix.py https://github.com/python/cpython/pull/152977/files#diff-c2ffce99c501f7f4b6bde21947391671e95f592edcdf8bddbe4706a5c59d4417
2026-07-08-06-54-57.gh-issue-152936.TaFl0J.rst https://github.com/python/cpython/pull/152977/files#diff-70cec62c144ccdac7a9174dd98f05a8981e11f7a3315dbdc86e9f7a007566c49
posixmodule.c https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
socketmodule.c https://github.com/python/cpython/pull/152977/files#diff-412f0023cab7bc5669c6c1e710a6f37e7c3c387d299794b5fe82268a10223b29
configure https://github.com/python/cpython/pull/152977/files#diff-90d08e583c4c9c6f391b2ae90f819f600a6326928ea9512c9e0c6d98e9f29ac2
configure.ac https://github.com/python/cpython/pull/152977/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
Doc/library/os.rsthttps://github.com/python/cpython/pull/152977/files#diff-cd9132e5234678864807ae34a75c5d4d6b894b31c327a4d3620fbd0c37eec16e
View file https://github.com/sabamdarif/cpython/blob/d4df9df278af2727cf0316e7447e93d85302aa60/Doc/library/os.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/152977/{{ revealButtonHref }}
https://github.com/python/cpython/pull/152977/files#diff-cd9132e5234678864807ae34a75c5d4d6b894b31c327a4d3620fbd0c37eec16e
Please reload this pagehttps://github.com/python/cpython/pull/152977/files
https://github.com/python/cpython/pull/152977/files#diff-cd9132e5234678864807ae34a75c5d4d6b894b31c327a4d3620fbd0c37eec16e
https://github.com/python/cpython/pull/152977/files#diff-cd9132e5234678864807ae34a75c5d4d6b894b31c327a4d3620fbd0c37eec16e
https://github.com/python/cpython/pull/152977/files#diff-cd9132e5234678864807ae34a75c5d4d6b894b31c327a4d3620fbd0c37eec16e
https://github.com/python/cpython/pull/152977/files#diff-cd9132e5234678864807ae34a75c5d4d6b894b31c327a4d3620fbd0c37eec16e
https://github.com/python/cpython/pull/152977/files#diff-cd9132e5234678864807ae34a75c5d4d6b894b31c327a4d3620fbd0c37eec16e
https://github.com/python/cpython/pull/152977/files#diff-cd9132e5234678864807ae34a75c5d4d6b894b31c327a4d3620fbd0c37eec16e
https://github.com/python/cpython/pull/152977/files#diff-cd9132e5234678864807ae34a75c5d4d6b894b31c327a4d3620fbd0c37eec16e
https://github.com/python/cpython/pull/152977/files#diff-cd9132e5234678864807ae34a75c5d4d6b894b31c327a4d3620fbd0c37eec16e
Doc/library/socket.rsthttps://github.com/python/cpython/pull/152977/files#diff-e9e93d6b76a8a1cf0825d557b12e7ce3e67081cad650063eee520b81fd651943
View file https://github.com/sabamdarif/cpython/blob/d4df9df278af2727cf0316e7447e93d85302aa60/Doc/library/socket.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/152977/{{ revealButtonHref }}
https://github.com/python/cpython/pull/152977/files#diff-e9e93d6b76a8a1cf0825d557b12e7ce3e67081cad650063eee520b81fd651943
https://github.com/python/cpython/pull/152977/files#diff-e9e93d6b76a8a1cf0825d557b12e7ce3e67081cad650063eee520b81fd651943
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L116
Doc/whatsnew/3.16.rsthttps://github.com/python/cpython/pull/152977/files#diff-e69e0be717f3409832d520e20348f62af39c9436ba1a9d82e842bc10e5eb51d7
View file https://github.com/sabamdarif/cpython/blob/d4df9df278af2727cf0316e7447e93d85302aa60/Doc/whatsnew/3.16.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/152977/{{ revealButtonHref }}
https://github.com/python/cpython/pull/152977/files#diff-e69e0be717f3409832d520e20348f62af39c9436ba1a9d82e842bc10e5eb51d7
https://github.com/python/cpython/pull/152977/files#diff-e69e0be717f3409832d520e20348f62af39c9436ba1a9d82e842bc10e5eb51d7
https://github.com/python/cpython/pull/152977/files#diff-e69e0be717f3409832d520e20348f62af39c9436ba1a9d82e842bc10e5eb51d7
https://github.com/python/cpython/pull/152977/files#diff-e69e0be717f3409832d520e20348f62af39c9436ba1a9d82e842bc10e5eb51d7
Lib/test/test_os/test_posix.pyhttps://github.com/python/cpython/pull/152977/files#diff-c2ffce99c501f7f4b6bde21947391671e95f592edcdf8bddbe4706a5c59d4417
View file https://github.com/sabamdarif/cpython/blob/d4df9df278af2727cf0316e7447e93d85302aa60/Lib/test/test_os/test_posix.py
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/152977/{{ revealButtonHref }}
https://github.com/python/cpython/pull/152977/files#diff-c2ffce99c501f7f4b6bde21947391671e95f592edcdf8bddbe4706a5c59d4417
https://github.com/python/cpython/pull/152977/files#diff-c2ffce99c501f7f4b6bde21947391671e95f592edcdf8bddbe4706a5c59d4417
https://github.com/python/cpython/pull/152977/files#diff-c2ffce99c501f7f4b6bde21947391671e95f592edcdf8bddbe4706a5c59d4417
Misc/NEWS.d/next/Library/2026-07-08-06-54-57.gh-issue-152936.TaFl0J.rsthttps://github.com/python/cpython/pull/152977/files#diff-70cec62c144ccdac7a9174dd98f05a8981e11f7a3315dbdc86e9f7a007566c49
View file https://github.com/sabamdarif/cpython/blob/d4df9df278af2727cf0316e7447e93d85302aa60/Misc/NEWS.d/next/Library/2026-07-08-06-54-57.gh-issue-152936.TaFl0J.rst
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/152977/{{ revealButtonHref }}
Modules/posixmodule.chttps://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
View file https://github.com/sabamdarif/cpython/blob/d4df9df278af2727cf0316e7447e93d85302aa60/Modules/posixmodule.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/152977/{{ revealButtonHref }}
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
https://github.com/python/cpython/pull/152977/files#diff-b5b7e4f5599916b2018e911ef423f9d3fd46cb71268e1a73c74a1c9ae2cb6791
Modules/socketmodule.chttps://github.com/python/cpython/pull/152977/files#diff-412f0023cab7bc5669c6c1e710a6f37e7c3c387d299794b5fe82268a10223b29
View file https://github.com/sabamdarif/cpython/blob/d4df9df278af2727cf0316e7447e93d85302aa60/Modules/socketmodule.c
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/152977/{{ revealButtonHref }}
https://github.com/python/cpython/pull/152977/files#diff-412f0023cab7bc5669c6c1e710a6f37e7c3c387d299794b5fe82268a10223b29
https://github.com/python/cpython/pull/152977/files#diff-412f0023cab7bc5669c6c1e710a6f37e7c3c387d299794b5fe82268a10223b29
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L84
configurehttps://github.com/python/cpython/pull/152977/files#diff-90d08e583c4c9c6f391b2ae90f819f600a6326928ea9512c9e0c6d98e9f29ac2
View file https://github.com/sabamdarif/cpython/blob/d4df9df278af2727cf0316e7447e93d85302aa60/configure
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/152977/files
https://github.com/python/cpython/blob/main/.github/CODEOWNERS#L84
configure.achttps://github.com/python/cpython/pull/152977/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
View file https://github.com/sabamdarif/cpython/blob/d4df9df278af2727cf0316e7447e93d85302aa60/configure.ac
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/152977/{{ revealButtonHref }}
https://github.com/python/cpython/pull/152977/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
https://github.com/python/cpython/pull/152977/files#diff-49473dca262eeab3b4a43002adb08b4db31020d190caaad1594b47f1d5daa810
Please reload this pagehttps://github.com/python/cpython/pull/152977/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.