Repository navigation
fix(chown,chgrp): align //e/.. ENOENT text and propagate recursive chgrp failures (#1262) - #1268
Conversation
…1259) (#1266) fix(chgrp,chown): refuse "." spellings resolved onto the shell root (#1259) CR verified (local Release MSVC build @ 0334c5f): - Targeted chgrp.*:chown.* 61/61 green, incl. the three new "."-refusal regressions per command (".", "./", "././" at the shell root refused with the "(same as '/')" suffix; not-refused below the root and with no shell root configured). - Path-identity comparison through the operand layer reproduces GNU's dev+ino failsafe shape at the shell root; MSYS display parity kept. - PR CI green (x64/arm64 build, oracle, compare). Merged over #1268's tracker: both append tests at EOF of the same files; #1268 needs a rebase after this lands.
|
CR 复核(fix/1262 → #1268):本地与 CI 验证全绿,但当前不可合并 —— 与 #1266(fix/1259)在同一组测试文件末尾形成 add/add 冲突,#1266 已先合入 main(150ccde),本 PR 需 rebase 后再合。 验证证据(本地 Release MSVC 构建 @ 2b48488)
冲突与解除方式
rebase 后我会复核 |
…grp failures (#1262) Three non-blocking items from the #1249 CR sweep: - 'chown Users //e/..' printed the Win32 path-syntax text where chgrp and the MSYS oracle print ENOENT: POSIX keeps "//e/.." rooted at '//e' (the two-slash rule), and Win32 rejects the UNC-ish folded name with ERROR_BAD_PATHNAME / ERROR_INVALID_NAME. Both now map onto 'No such file or directory' in format_chown_error (chmod's format_access_error precedent), so all three print "cannot access '//e/..': No such file or directory". - chgrp's process_directory dropped a directory child's change_group result and the recursive call's return, so a failing descendant still exited 0; both now fold into success like chown's process_recursive. - The '///' display convention is now documented in DOCS/gnu-coreutils/{chgrp,chown}.md: diagnostics quote the operand as typed, so '///' prints verbatim where MSYS shows '/' after its own argv-layer collapse - same refusal, display-only divergence. Tests: pin the ENOENT reason text in both commands' //e/.. refusal rows and add chgrp_recursive_descendant_failure_reaches_exit_code, which makes a descendant's named security call fail deterministically via a DENY GENERIC_ALL self-ACE (no privileges needed) and asserts rc 1 plus the per-descendant diagnostics. 87/87 across the chgrp/chown/mkfifo/mknod/chcon suites; no i18n catalog delta (no extracted literal changed).
2b48488 to
1fe37c3
Compare
|
Rebased onto Conflict: add/add at EOF of Tests (local MSVC Debug build, New HEAD: |
Summary
chown/chgrpnow printcannot access '//e/..': No such file or directoryfor//e/..-class operands — chown previously emitted the Win32 path-syntax text (ERROR_BAD_PATHNAME/ERROR_INVALID_NAMEmapped to ENOENT informat_chown_error, matching chmod'sformat_access_errorprecedent and the MSYS oracle byte-for-byte).chgrp -Rpropagates a failing descendant throughprocess_directory(the directory child's ownchange_groupresult and the nested call's return were both dropped, so a failed descendant still exited 0), matching chown'sprocess_recursivesemantics.///display convention is documented inDOCS/gnu-coreutils/{chgrp,chown}.md: diagnostics quote the operand verbatim (on '///'), where MSYS printson '/'because its own argv layer collapses///before the binary runs — same refusal, display-only divergence. Item 4 of the issue (.at the shell root) is already tracked by preserve-root 边角: 在 shell root 处仍走树(GNU dev+ino 会拒)——#1249 CR nits #1259 and out of scope here.Test plan
winuxcmd-tests --gtest_filter='chgrp.*:chown.*'→ 56/56 (incl. newchgrp_recursive_descendant_failure_reaches_exit_code, which forces deterministic descendant failures via a DENYGENERIC_ALLself-ACE — no privileges needed — and asserts rc 1 + both per-descendant diagnostics; on the unfixed code this returns rc 0)mkfifo.*:mknod.*:chcon.*→ 31/31 (fix(mkfifo/mknod + chgrp/chown/chcon): fold POSIX drive-dialect operands before any Win32 call (#1235, #1241) #1249 family no regression)chown/chgrp Users //e/..→cannot access '//e/..': No such file or directoryrc 1;-R --preserve-root Users ///→it is dangerous ... '///'rc 1--dry-run --Werrorclean on all touched C++ filessafeErrorPrint/unexpected/OPTION/help) changed, so nowinuxcmd-i18nsync is required for this patchFixes #1262
Generated with Devin