gh-152936: Make privileged functions available on Android#152977
gh-152936: Make privileged functions available on Android#152977sabamdarif wants to merge 1 commit into
Conversation
|
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 |
|
it's my first pr here so i don't know much about the NEWS entry, if it's not a problem can anyone tell me if i do need to add any NEWS entry ? |
Documentation build overview
|
thanks for the PR, as per my thought yes, this will need NEWS entry but you can wait for the review and then you can add NEWS entry ( to get 100 % sure 😀) |
|
i have another question for the Android test failure should i update the test_posix.py ? to do something like |
|
why did the Tests / Sanitizers / TSan (free-threading) (pull_request) failed i don't get it ? |
|
We can see that the cause of one of the test failures probably is that the Python test suite has interpreted the unblocking of cpython/Lib/test/test_os/test_posix.py Lines 99 to 105 in 0621639 I would say that yes, the test should probably be modified to check for Android platform, and in the case of Android platform, only test that function if the test is running as root user; however, what I find concerning is that the CI here only produced a failure for x86_64, and not for aarch64, even though in my own separate test, both x86_64 and aarch64 architectures of Android should be returning the same result from the same function:
I wonder if that suggests there is a deeper problem with the tests or an inconsistency somewhere in the test implementation between x86_64 and aarch64. |
|
@robertkirkman yes, let see what others are saying about this . I still didn't get any other comment from any of the core maintainers |

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