Skip to content

fix(glob,redirect): globstar symlink forms (#1671, #1672) + extglob ambiguous redirect (#1673) - #1764

Merged
caomengxuan666 merged 3 commits into
masterfrom
fix8/glob
Oct 26, 2026
Merged

caomengxuan666 merged 3 commits into
masterfrom
fix8/glob

Conversation

@caomengxuan666

@caomengxuan666 caomengxuan666 commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Fixes #1671
Fixes #1672
Fixes #1673

根因

集成与验证

  • 集成方已 rebase 到现行 master 160e7928(簇基线 2157a3af 之后 33 个 commit 零触碰本片四个文件,零冲突;四文件与簇内 verified-tree/ 的 md5 逐一相同,修法形状未动)。
  • 探针五件(probe1671/1671b/1672/1672b/1673)对 GNU bash 5.3.20 oracle 逐字节一致、diffcorpus 306 裁定失败集 {ms10}:簇内已验,见簇 REPORT。
  • Targeted(rebase 后集成方复跑):issue1671 ×3、issue1672 ×2、issue1673 ×3、issue1466 ×14、issue424 ×1,全过(rc=0)。
  • cargo test --lib 全量同集门(集成方补跑,簇内四度入队未出槽):771 passed / 1 failed / 1 ignored(口径 --skip login_posix_env),唯一失败 = ownership_unary_operators_check_existing_file,与 master 基线同集。

GitHub CI 的三个红 job 是 master 存量(macOS kill 常量 / Windows goldens lane / darwin cross-target),与本片无关,按主会话口径以本地门合并。

…ect checks (rubash#1673)

pathexp.c unquoted_glob_pattern_p counts an unquoted +, @ or ! followed by ( as a glob introducer when extended_glob is set; redirect_target_is_ambiguous only knew $, `, {, *, ?, [, so > @(a.txt|b.txt) with several matches was joined into one space-separated literal filename and written with rc=0 instead of failing with ambiguous redirect. Pass the extglob state from both call sites (expand_word.rs, redirection.rs).

Regression: tests/issue1673_extglob_redirect_ambiguous_regressions.rs
…efixes (rubash#1672)

glob.c glob_filename skips a symlinked directory enumerated by ** only when the directory part consists solely of ** segments (all_starstar). With any literal prefix (./, sub/, absolute) the remaining pattern is applied inside the linked directory one level; the ** enumeration itself still never descends into the link. collect_globstar_matches now takes follow_symlink_suffix (set from a non-empty literal prefix) and applies a non-empty suffix to the linked directory's direct entries.

Regression: tests/issue1672_globstar_prefix_symlink_traversal_regressions.rs
…ments (rubash#1671)

collect_multi_globstar_paths pushed every symlink child of a ** enumeration as a final match even when pattern segments remained, appending every cwd symlink name (dangling included) to **/deep/* and friends. Per glob.c's all_starstar special case, the link itself is a match only when ** is the final segment; with segments remaining and an all-** directory part the link contributes nothing; with a literal or absolute prefix the remaining segments are applied inside the linked directory (one segment consumed, the enumeration itself never descends).

Regression: tests/issue1671_globstar_symlink_bare_names_regressions.rs
@caomengxuan666 caomengxuan666 changed the title WIP: fix8/glob — globstar symlink forms (#1671, #1672) + extglob ambiguous redirect (#1673) fix(glob,redirect): globstar symlink forms (#1671, #1672) + extglob ambiguous redirect (#1673) Oct 26, 2026
@caomengxuan666
caomengxuan666 marked this pull request as ready for review October 26, 2026 09:03
@caomengxuan666
caomengxuan666 merged commit 159e74a into master Oct 26, 2026
8 of 9 checks passed
@caomengxuan666
caomengxuan666 deleted the fix8/glob branch October 30, 2026 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant