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
{{ message }}
Repository navigation
[bug] ~user expands unknown usernames to / (or /data) instead of leaving literal #1233
P2-medium中:次要缺陷或边缘路径,排期修复area:expansionword splitting, quote removal, parameter/brace expansionbugSomething isn't workinggnu-baselineTracked by the GNU Bash 5.3.0 true-baseline ledger
Pattern: a hardcoded Android fallback table (root/daemon/… → /, u0_a* → /data) is consulted instead of (or before) the user database, and failure falls back to / rather than leaving the word literal. Safety-relevant: rm -rf ~typo/dir would resolve to //dir under niu. On desktop Linux with a real /etc/passwd the outcome may differ — needs a check there too — but the no-such-user case must stay literal per GNU.
Env: niubash 1.4.4 / rubash engine 1b14a3d, GNU bash 5.3.20 aarch64-linux-android as oracle (empty /etc/passwd).
P2-medium中:次要缺陷或边缘路径,排期修复area:expansionword splitting, quote removal, parameter/brace expansionbugSomething isn't workinggnu-baselineTracked by the GNU Bash 5.3.0 true-baseline ledger
Activity
caomengxuan666 commentedon Oct 23, 2026
Same fallback table fires in assignment/declare/tempenv positions (verified niu 1.4.4 vs bash 5.3.20 Termux, 3/3):
v=~root; echo "v=$v"→ bash~root, niu/;v=~root/x→//x;declare dr=~root→/;A=~root env | grep A→/. GNU leaves all literal (empty /etc/passwd). No new issue — same root, additional slots.caomengxuan666 commentedon Oct 24, 2026
复核结论:未复现,按证据关单。glibc 基线实测(x6 簇复核):
~root→/root、~daemon→/usr/sbin、~bin→/bin,均为真实 getpwnam 结果、与 GNU bash 5.3.20 逐字节一致;~nosuchuser_xyz、~u0_a123两边都保持字面。代码走真实用户数据库查询,issue 所述硬编码 Android 回退表在 glibc 路径上不存在。若在 Android/设备环境仍可复现,请附设备环境与复现命令重开。