From 8cbd19f79ddc739671a6e2d6306d3ab040472a4a Mon Sep 17 00:00:00 2001 From: Luca Weiss Date: Sat, 26 Aug 2023 17:12:57 +0200 Subject: [PATCH] main/postmarketos-mkinitfs-hook-debug-shell: fix launching telnet (MR 4350) With the recent changes in commit 80fff9242, there's no longer an $IP variable we can use. Use the same code as in init_functions.sh to get the potentially customized IP address to use for telnet. --- .../20-debug-shell.sh | 6 ++++-- main/postmarketos-mkinitfs-hook-debug-shell/APKBUILD | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/main/postmarketos-mkinitfs-hook-debug-shell/20-debug-shell.sh b/main/postmarketos-mkinitfs-hook-debug-shell/20-debug-shell.sh index 27b58d452..f09cbe736 100644 --- a/main/postmarketos-mkinitfs-hook-debug-shell/20-debug-shell.sh +++ b/main/postmarketos-mkinitfs-hook-debug-shell/20-debug-shell.sh @@ -40,7 +40,9 @@ echo "Start the telnet daemon" echo "sh" } >/telnet_connect.sh chmod +x /telnet_connect.sh -telnetd -b "${IP}:${TELNET_PORT}" -l /telnet_connect.sh + +host_ip="${unudhcpd_host_ip:-172.16.42.1}" +telnetd -b "${host_ip}:${TELNET_PORT}" -l /telnet_connect.sh # mount pstore, if possible if [ -d /sys/fs/pstore ]; then @@ -52,7 +54,7 @@ mount -t debugfs none /sys/kernel/debug || true ln -s /sys/kernel/debug /d echo "---" -echo "WARNING: debug-shell is active on ${IP}:${TELNET_PORT}." +echo "WARNING: debug-shell is active on ${host_ip}:${TELNET_PORT}." echo "This is a security hole! Only use it for debugging, and" echo "uninstall the debug-shell hook afterwards!" echo "---" diff --git a/main/postmarketos-mkinitfs-hook-debug-shell/APKBUILD b/main/postmarketos-mkinitfs-hook-debug-shell/APKBUILD index a42cf8c30..bf6e775c7 100644 --- a/main/postmarketos-mkinitfs-hook-debug-shell/APKBUILD +++ b/main/postmarketos-mkinitfs-hook-debug-shell/APKBUILD @@ -1,5 +1,5 @@ pkgname=postmarketos-mkinitfs-hook-debug-shell -pkgver=0.4.5 +pkgver=0.4.6 pkgrel=0 pkgdesc="Root shell in the initramfs (security hole, for debugging only)" url="https://postmarketos.org" @@ -17,6 +17,6 @@ package() { } sha512sums=" -90829cc17d62932730720d6a4d205c9e0093303f6d09865a4d4e83e08677cf4005cf38b02cde546082d60cf97264ddf60b4d76893d0f87e3bda4729bc04a171a 20-debug-shell.sh +0afe6aebeef653f7d61d37f69814df3ddb690a14f2c9326f02eabfcfb46aa168c45bd89e31145a6857f3641a89671d9e19d491065b5900300281af7208ca0efc 20-debug-shell.sh 845d2eb6ab72c5c1472d65305241ca21dbc26784684e9ae99a180a255f8f7f62123b363d73c642df1f9687106340078311a68a76c123f16829b941bff9151735 20-debug-shell.files "