Skip to content

fix(du/cksum): #1748 LX dir traversal, #1752 base64 check, #1753 dead enum - #1756

Merged
caomengxuan666 merged 1 commit into
mainfrom
fix/followups-1748-1752-1753
Nov 14, 2026
Merged

caomengxuan666 merged 1 commit into
mainfrom
fix/followups-1748-1752-1753

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

Closes #1748 #1752 #1753. du walks followed LX directory links (child and operand) with operand spelling; cksum accepts base64 check lines per digest.c valid_digits while hex stays case-insensitive; removes the dead Crc32b enum. cargo 944/0; du/cksum gtest 111; gate 86 pass.

… enum

- du: followed LX child/operand dir links walk the target with operand spelling (gate du50/51)
- cksum: accept base64 digests in check lines (digest.c valid_digits), hex unchanged
- digest.cppm: drop the dead HashAlgorithm::Crc32b branch
- cargo 944/0; cksum/du gtest 111; gate 86 pass
@caomengxuan666
caomengxuan666 marked this pull request as ready for review November 14, 2026 16:22
@caomengxuan666
caomengxuan666 merged commit 971310d into main Nov 14, 2026
7 of 10 checks passed
@caomengxuan666
caomengxuan666 deleted the fix/followups-1748-1752-1753 branch November 14, 2026 16:22
aphrody-dev pushed a commit to aphrody-labs/WinuxCmd that referenced this pull request Nov 17, 2026
…unixwin#1462)

The baseline gate's two red rows (the reason every fleet PR has been
inheriting a red main since unixwin#1756-era merges):

1. du/05-threshold-neg-zero: the parser was a bare i64 parse — it
   accepted "--threshold=-0" (GNU rejects), rejected every SIZE suffix
   GNU accepts (du.c:899-903 xstrtoimax "kKmMGTPEZYRQ0"), and had no
   invalid-suffix / too-large message shapes. parse_threshold now
   mirrors gnulib xstrtol.c __xstrtol byte-for-byte: sign + digits,
   a lone suffix means 1, binary single suffixes k/K..Q, the '0' flag
   second suffix ("iB" binary, "B"/"D" decimal), the three
   xstrtol_error msgids ("invalid --threshold argument 'X'" /
   "invalid suffix in --threshold argument 'X'" / "--threshold
   argument 'X' too large", exit 1, no try-help), and du.c:906-912's
   negative-zero rejection with the LITERAL '-0' in the message
   however the zero was spelled.

2. du/02-summarize-all-conflict: "-a -s" ran silently. du.c:1004-1008
   rejects the pair before any walk with "cannot both summarize and
   show all entries" + usage(EXIT_FAILURE)'s try-help line, rc 1.

Also fixes the threshold UNIT (du.c:718-726): GNU compares against
dui_to_print.size — the value ALREADY scaled for printing — while the
pre-fix gate compared raw bytes, so a negative threshold never printed
a row at all (probed: -4 elides an 8-block "." but keeps the 4-block
"./sub"; -1024 shows both; -1 elides both). threshold_value feeds the
scaled print value into the comparison at all three gates.

GNU anchors: coreutils @5f6c02d3 src/du.c:899-913, :1004-1008, :718-726;
gnulib xstrtol.c __xstrtol + xstrtol-error.c xstrtol_error. Verified
against the WSL GNU 9.4 oracle probe class matrix (-0 rejected, 0 and
negative non-zero accepted, 1k/-1k/k/1KiB scaled).

cargo test winux-cmds 1016/1016. catalog/en-US.json: 3 new keys
(summarize_conflict, invalid_threshold_suffix, threshold_too_large);
zh-CN companion rides the winuxcmd-i18n sync chain.
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