Skip to content

Potential issue with Termux #98

@easyaspi314

Description

@easyaspi314

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions