termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.25k stars 3.05k forks source link

[Bug]: inetutils: inetd broken #21126

Open ossilator opened 2 months ago

ossilator commented 2 months ago

Problem description

inetd is unable to serve anything; it says "tcp: unknown protocol". i suppose the reason for that is that it cannot read /etc/protocols or something equivalent, due to missing selinux permissions. logcat reports avc: denied { search } name="tests" [...] app=com.termux.boot.

What steps will reproduce the bug?

create $PREFIX/etc/inetd.conf with this content: echo stream tcp nowait <your id here> internal then run $PREFIX/libexec/inetd

What is the expected behavior?

telnet localhost echo connects and echoes input.

System information

Termux Variables:
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=5988
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.1
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://grimler.se/termux/termux-main stable main
Updatable packages:
All packages up to date
termux-tools version:
1.43.3
Android version:
13
Kernel build information:
Linux localhost 4.19.191-g3d85b3724632 #1 SMP PREEMPT Thu Aug 1 21:44:14 CST 2024 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
2201117SY
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.boot versionCode:1000
Biswa96 commented 2 months ago

May I ask what Android OS you are using?

ossilator commented 2 months ago

the newest stock rom for this device, xiaomi hyperos.

truboxl commented 2 weeks ago

I believe they are caused by getprotobyname() being broken/stub in Bionic which intentionally returns nothing https://android.googlesource.com/platform/bionic/+/refs/heads/main/libc/include/netdb.h#233 https://fossies.org/linux/inetutils/src/inetd.c#:~:text=849%20%20%20%20%20proto%20%3D%20getprotobyname%20(%22tcp%22)%3B