You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[bug] export -f serialization strips quotes, leaks internal markers — every quoted exported function corrupts in children (HIGH)
niu re-serializes the parsed AST into BASH_FUNC_name%% without re-quoting. printenv 'BASH_FUNC_q%%' | od -c for q() { echo "$1"; echo "$@"; echo "a b"; echo '$single'; x="a b"; }:
GNU: () { echo "$1";\n … x="a b" … }
niu: () {\n echo $1;\n echo $@;\n echo a b;\n echo \037single;\n x=a b;\n echo $x\023\n} — all " gone, '…' → \037… with no closer, trailing \023.
q() { x="a b";echo"[$x]"; }; export -f q; bash -c 'q'# bash parent: [a b], rc=0# niu parent: environment: line 1: b: command not found + [], rc=0
Single quotes round-trip niu→niu via internal markers, but leak raw \037 into real bash children (s() { echo '$HOME'; } → child prints \037HOME). Only safe case: no quotes at all. Direction bash→niu imports GNU encoding correctly. Silent corruption — high severity.
Env: niubash 1.4.4 / rubash engine (master ~2026-10), GNU bash 5.3.20 aarch64-linux-android as oracle.
Fixed by #1181 (2026-10-22/23 bulk GNU-parity wave): landed as a dedicated commit referencing this issue, covered by the audit differential suite (tests/fixtures/audit/), and re-verified byte-for-byte against a GNU bash 5.3.20 oracle; master CI (ff1a555) runs the suite green.
Closing now to restore the linkage: GitHub's closing-reference parser only honored the first entry of #1181's long Fixes list, so this stayed open after the fix landed. If anything still reproduces on current master, reopen with a transcript and it returns to the fix queue.
Activity
github-actions commentedon Oct 22, 2026
欢迎!这是你在本仓库的第一个 ISSUE 🎉 维护者会尽快跟进;报 bug 请附
rubash --version、系统平台与最小复现脚本。caomengxuan666 commentedon Oct 23, 2026
Fixed by #1181 (2026-10-22/23 bulk GNU-parity wave): landed as a dedicated commit referencing this issue, covered by the audit differential suite (tests/fixtures/audit/), and re-verified byte-for-byte against a GNU bash 5.3.20 oracle; master CI (ff1a555) runs the suite green.
Closing now to restore the linkage: GitHub's closing-reference parser only honored the first entry of #1181's long
Fixeslist, so this stayed open after the fix landed. If anything still reproduces on current master, reopen with a transcript and it returns to the fix queue.