Skip to content

Commit

Permalink
scripts: Fix permission denied errors for pm and settings by only…
Browse files Browse the repository at this point in the history
… exporting `/system/bin` in `$PATH` and not termux bin path for system utilities wrappers

The utilities like `/system/bin/pm` and `/system/bin/settings` run the `cmd` command and if termux bin path exists in `$PATH`, then `$TERMUX__PREFIX/bin/cmd` wrapper will be executed instead of `/system/bin`, which will fail due to selinux denial even with the subshell hack (termux/termux-packages#8292 (comment)).

`avc:  denied  { execute_no_trans } for  path="/data/data/com.termux/files/usr/bin/cmd" dev="dm-55" ino=46573 scontext=u:r:untrusted_app:s0:c29,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c29,c257,c512,c768 tclass=file permissive=0 app=com.termux`
  • Loading branch information
agnostic-apollo committed Dec 23, 2023
1 parent 22fe0aa commit be50057
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ $1: Makefile
@echo 'unset LD_LIBRARY_PATH LD_PRELOAD' >> $1
# Some tools require having /system/bin/app_process in the PATH,
# at least am&pm on a Nexus 6p running Android 6.0
@echo -n 'PATH=$$$$PATH:/system/bin ' >> $1
@echo -n 'PATH=/system/bin ' >> $1
@echo "exec /system/bin/$1 \"\$$$$@\"" >> $1
@chmod u+x $1
endef
Expand Down

0 comments on commit be50057

Please sign in to comment.