diff --git a/busybox/20-fix-ash-nofork-interrupted.patch b/busybox/20-fix-ash-nofork-interrupted.patch new file mode 100644 index 0000000..44c759b --- /dev/null +++ b/busybox/20-fix-ash-nofork-interrupted.patch @@ -0,0 +1,23 @@ +diff --git a/shell/ash.c b/shell/ash.c +--- a/shell/ash.c ++++ b/shell/ash.c +@@ -9745,9 +9745,18 @@ evalcommand(union node *cmd, int flags) + /* find_command() encodes applet_no as (-2 - applet_no) */ + int applet_no = (- cmdentry.u.index - 2); + if (applet_no >= 0 && APPLET_IS_NOFORK(applet_no)) { ++ INT_OFF; + listsetvar(varlist.list, VEXPORT|VSTACK); +- /* run _main() */ ++ /* ++ * Run _main(). ++ * Signals (^C) can't interrupt here. ++ * Otherwise we can mangle stdio or malloc internal state. ++ * This makes applets which can run for a long time ++ * and/or wait for user input ineligible for NOFORK: ++ * for example, "yes" or "rm" (rm -i waits for input). ++ */ + status = run_nofork_applet(applet_no, argv); ++ INT_ON; + break; + } + #endif