Proposal:
configure.ac contains a list of privileged functions which are "blocked" on Android, i.e. they simply won't exist in the stdlib. This was because when any of the underlying C functions are called by a non-root user, instead of returning a PermissionError as they would on Linux, they cause a low-level crash of the whole process.
This approach has 2 problems:
- Users of these functions will probably be able to handle a PermissionError, but not an AttributeError.
- It prevents using the functions on rooted devices.
Termux is working around this by making Python check the UID and raise the PermissionError itself in a non-root context. I think it would be a good idea to adopt this upstream.
- This change should only affect Android; on other platforms, UID checks should continue to be done by the underlying C function.
- Most of these functions are documented as "not Android"; that should also be removed.
- Functions which are blocked in configure.ac for other reasons should continue to be blocked.
Has this already been discussed elsewhere?
I have already discussed this feature proposal on the Termux issue tracker
Links to previous discussion of this feature:
Linked PRs
Proposal:
configure.ac contains a list of privileged functions which are "blocked" on Android, i.e. they simply won't exist in the stdlib. This was because when any of the underlying C functions are called by a non-root user, instead of returning a PermissionError as they would on Linux, they cause a low-level crash of the whole process.
This approach has 2 problems:
Termux is working around this by making Python check the UID and raise the PermissionError itself in a non-root context. I think it would be a good idea to adopt this upstream.
Has this already been discussed elsewhere?
I have already discussed this feature proposal on the Termux issue tracker
Links to previous discussion of this feature:
Linked PRs