-
-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
Termux uses LD_PRELOAD
and LD_LIBRARY_PATH
to redirect /usr/bin
and /bin
calls to call /data/data/com.termux/files/usr/bin
, as Android doesn't have /usr or /bin, and pretty much all shebang scripts assume that at least /bin/sh
and /usr/bin/env
exist.
For example,
$ /usr/bin/zsh --version
zsh 5.4.2 (arm-unknown-linux-androideabi)
$ ls /usr
ls: cannot access '/usr': No such file or directory
$ export LD_PRELOAD=""
$ /usr/bin/zsh --version
CANNOT LINK EXECUTABLE "/usr/bin/zsh": can't read file "/data/data/com.termux/files/usr/lib": Is a directory
[1] 16502 abort /usr/bin/zsh
$
While I haven't directly found an instance of this happening in my quick tests, I just want to warn you that this may occur if you overwrite the environment variable.
Metadata
Metadata
Assignees
Labels
No labels