Skip to content
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

When termux uses the system signature, an error is reported when the command is executed #2189

Closed
tangzeyu7 opened this issue Jul 26, 2021 · 7 comments

Comments

@tangzeyu7
Copy link

can't execute: Permission denied

Configuration

  • Termux uses the system signature in the platform source code
    platform签名

  • Configure sharedUserId="android.uid.system" in AndroidManifest
    sharedUserId

Phenomenon

Session mode

  • Start interface

  • Execute Command

Failsafe mode

  • The start interface is consistent with the Session

  • Execute Command

  • ls -l



  • Execute Command: ./

What causes this problem? How to solve it?

@agnostic-apollo
Copy link
Member

Are you on android 10+? If yes, then likely issue considering that now termux will be running as the user of the system package, its targetSdkVersion restrictions would apply and not termux's own. That's why /system/bin binaries work fine but not the ones in termux's own priv app data dir under $PREFIX. Check https://github.com/termux/termux-packages/wiki/Termux-and-Android-10

Check logcat for confirmation, likely selinux avc denial entries.

I wonder why sh session started in normal session instead of bash (failing), maybe canExecute() failed (unless OP changed default). 🤔

@tangzeyu7
Copy link
Author

Are you on android 10+? If yes, then likely issue considering that now termux will be running as the user of the system package, its targetSdkVersion restrictions would apply and not termux's own. That's why /system/bin binaries work fine but not the ones in termux's own priv app data dir under $PREFIX. Check https://github.com/termux/termux-packages/wiki/Termux-and-Android-10

Check logcat for confirmation, likely selinux avc denial entries.

I wonder why sh session started in normal session instead of bash (failing), maybe canExecute() failed (unless OP changed default). 🤔

You're right, it does run on Android 10.
Error log:

2021-07-27 09:44:47.910 18506-18506/com.termux W/com.termux: type=1400 audit(0.0:1245): avc: denied { execute } for name="login" dev="dm-8" ino=644006 scontext=u:r:system_app:s0 tcontext=u:object_r:system_app_data_file:s0 tclass=file permissive=0
2021-07-27 09:45:00.002 18594-18594/? W/sh: type=1400 audit(0.0:1277): avc: denied { execute } for name="coreutils" dev="dm-8" ino=646644 scontext=u:r:system_app:s0 tcontext=u:object_r:system_app_data_file:s0 tclass=file permissive=0

This problem has been bothering me for 2 days, thank you for your help!

@agnostic-apollo
Copy link
Member

You are welcome.

@TREYWANGCQU
Copy link

Thanks

@agnostic-apollo
Copy link
Member

@tangzeyu7 You may wanna check out #2445 (comment).

@tangzeyu7
Copy link
Author

@tangzeyu7 You may wanna check out #2445 (comment).

OK, thank you for reminding me.

@agnostic-apollo
Copy link
Member

Welcome.

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

No branches or pull requests

3 participants