Skip to content

chmod,mkdir,install,mkfifo,mknod: reject octal clauses and empty modes in mode lists - #14643

Open
krosci wants to merge 1 commit into
uutils:mainfrom
krosci:mode-reject-octal-in-list
Open

krosci wants to merge 1 commit into
uutils:mainfrom
krosci:mode-reject-octal-in-list

Conversation

@krosci

@krosci krosci commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Fixes #14421.

The mode parser accepted an octal clause anywhere inside a comma-separated list and skipped empty clauses, where GNU only allows a bare octal as the entire mode string and rejects empty clauses. The comma-list loop was duplicated in chmod, so the grammar now lives once in uucore::mode, with chmod routed through it via parse_chmod_with_naive to keep its umask diagnostic; a caret-aware clause_start in ModeError lets a diagnostic point at the rejected clause. Tests cover both tables from the issue for chmod, mkdir, install, mkfifo and mknod.

@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/chmod/setgid. tests/chmod/setgid is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/date/resolution (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/misc/tty-eof (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/tail-n0f (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/unexpand/bounded-memory is now passing!

@krosci
krosci force-pushed the mode-reject-octal-in-list branch from ea045fe to c00b5b8 Compare September 18, 2026 11:43
@krosci
krosci force-pushed the mode-reject-octal-in-list branch from c00b5b8 to ce54f45 Compare September 18, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mode: comma-separated mode strings accept forms GNU rejects

1 participant