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

[Bug]: default $PATH contains an inaccssible directory /system_ext/bin #178

Open
mgedmin opened this issue Nov 2, 2024 · 1 comment
Open

Comments

@mgedmin
Copy link

mgedmin commented Nov 2, 2024

Problem description

The default value of $PATH in my Termux shell is

$ echo $PATH | tr : '\n'
/usr/games
/usr/local/sbin
/usr/local/bin
/usr/sbin
/sbin
/data/data/com.termux/files/usr/bin
/product/bin
/apex/com.android.runtime/bin
/apex/com.android.art/bin
/system_ext/bin
/system/bin
/system/xbin
/odm/bin
/vendor/bin
/vendor/xbin

One of these things is not like the others:

$ ls -l /system_ext/bin
ls: cannot open directory '/system_ext/bin': Permission denied

$ ls -ld /system_ext/bin
drwxr-x--x. 3 root shell 4096 Jan  1  2009 /system_ext/bin

which causes programs that loop through all $PATH entries (e.g. pypa/virtualenv#2794).

Actually, three more of those directories are inaccessible:

$ ls /system/xbin /odm/bin /vendor/bin /vendor/xbin
ls: cannot access '/system/xbin': No such file or directory
ls: cannot access '/vendor/xbin': No such file or directory
/odm/bin

ls: cannot open directory '/vendor/bin': Permission denied

What steps will reproduce the bug?

Install Termux from the Google Play Store, launch it, look at $PATH.

What is the expected behavior?

PATH contains only directories that the Termux user (u0_a368, although I wonder if this varies per device) can actually access.

System information

Termux Variables:
TERMUX_EXEC__PROC_SELF_EXE=/data/data/com.termux/files/usr/bin/termux-info
TERMUX_VERSION=googleplay.2024.10.30
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://termux.net stable main
Updatable packages:
All packages up to date
termux-tools version:
3.0.8
Android version:
14
Kernel build information:
Linux localhost 5.15.137-android14-11-gbc062a78e195-ab12057991 #1 SMP PREEMPT Mon Jul 8 12:34:46 UTC 2024 aarch64 Android
Device manufacturer:
Google
Device model:
Pixel 8a
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
@a404050aaa
Copy link

Problem description

The default value of $PATH in my Termux shell is

$ echo $PATH | tr : '\n'
/usr/games
/usr/local/sbin
/usr/local/bin
/usr/sbin
/sbin
/data/data/com.termux/files/usr/bin
/product/bin
/apex/com.android.runtime/bin
/apex/com.android.art/bin
/system_ext/bin
/system/bin
/system/xbin
/odm/bin
/vendor/bin
/vendor/xbin

One of these things is not like the others:

$ ls -l /system_ext/bin
ls: cannot open directory '/system_ext/bin': Permission denied

$ ls -ld /system_ext/bin
drwxr-x--x. 3 root shell 4096 Jan  1  2009 /system_ext/bin

which causes programs that loop through all $PATH entries (e.g. pypa/virtualenv#2794).

Actually, three more of those directories are inaccessible:

$ ls /system/xbin /odm/bin /vendor/bin /vendor/xbin
ls: cannot access '/system/xbin': No such file or directory
ls: cannot access '/vendor/xbin': No such file or directory
/odm/bin

ls: cannot open directory '/vendor/bin': Permission denied

What steps will reproduce the bug?

Install Termux from the Google Play Store, launch it, look at $PATH.

What is the expected behavior?

PATH contains only directories that the Termux user (u0_a368, although I wonder if this varies per device) can actually access.

System information

Termux Variables:
TERMUX_EXEC__PROC_SELF_EXE=/data/data/com.termux/files/usr/bin/termux-info
TERMUX_VERSION=googleplay.2024.10.30
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://termux.net stable main
Updatable packages:
All packages up to date
termux-tools version:
3.0.8
Android version:
14
Kernel build information:
Linux localhost 5.15.137-android14-11-gbc062a78e195-ab12057991 #1 SMP PREEMPT Mon Jul 8 12:34:46 UTC 2024 aarch64 Android
Device manufacturer:
Google
Device model:
Pixel 8a
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so

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

2 participants