]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
busybox: fix signal handling in non-interactive envirement 23787/head
authorSeo Suchan <tjtncks@gmail.com>
Sun, 14 Jun 2026 04:07:23 +0000 (13:07 +0900)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sun, 14 Jun 2026 09:51:50 +0000 (11:51 +0200)
fixes  https://github.com/openwrt/openwrt/issues/23745

upstream had bug bb_got_signal to be never cleared in noninteractive session, this fixes this while waiting for upstream merge.

the patch iself is written by  Ian Cooper <iancooper@hotmail.com>

Signed-off-by: Seo Suchan <tjtncks@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23787
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
package/utils/busybox/Makefile
package/utils/busybox/patches/302-ash-clear-bb_got_signal-for-non-interactive-shell.patch [new file with mode: 0644]

index 24e539e3396dc901c13f53e62496956179d28d23..740bf407faa8b6a7ddb2f7b39e745b1bc68d5d95 100644 (file)
@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=busybox
 PKG_VERSION:=1.38.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_FLAGS:=essential
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
diff --git a/package/utils/busybox/patches/302-ash-clear-bb_got_signal-for-non-interactive-shell.patch b/package/utils/busybox/patches/302-ash-clear-bb_got_signal-for-non-interactive-shell.patch
new file mode 100644 (file)
index 0000000..fc74357
--- /dev/null
@@ -0,0 +1,34 @@
+From 8a7c45305f37bc7138c329d8f7debef8a4c9ddad Mon Sep 17 00:00:00 2001
+From: Seo Suchan <tjtncks@gmail.com>
+Date: Fri, 12 Jun 2026 11:37:18 +0900
+Subject: [PATCH] ash: clear bb_got_signal for non-interactive shell
+
+Patch itself origianlly submitted by Ian Cooper <iancooper@hotmail.com>
+
+preadfd doesn't run in non-interactive shells, but it can set in non_interactive shells too.
+we always need to clear bb_got_signal otherwise it wll infinite loop.
+clean this flag when ash processes trap as backup.
+
+Fixes: #23745
+Upstream-Status: Reported https://github.com/vda-linux/busybox_mirror/issues/16
+Suggested-by: Ian Cooper <iancooper@hotmail.com>
+
+Signed-off-by: Seo Suchan <tjtncks@gmail.com>
+---
+ shell/ash.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/shell/ash.c b/shell/ash.c
+index fb887f31b..3eb73eaa4 100644
+--- a/shell/ash.c
++++ b/shell/ash.c
+@@ -9608,6 +9608,9 @@ dotrap(void)
+               savestatus = status;
+       }
+       pending_sig = 0;
++#if ENABLE_FEATURE_EDITING
++      bb_got_signal = 0;
++#endif
+       barrier();
+       TRACE(("dotrap entered\n"));