Skip to content

uucore/safe_copy: use rustix Mode flags to avoid mode_t width mismatch#12140

Merged
sylvestre merged 1 commit into
uutils:mainfrom
sylvestre:unbreak-safe
May 4, 2026
Merged

uucore/safe_copy: use rustix Mode flags to avoid mode_t width mismatch#12140
sylvestre merged 1 commit into
uutils:mainfrom
sylvestre:unbreak-safe

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

No description provided.

flags,
Mode::from_bits_truncate(DEST_INITIAL_MODE),
)?;
let fd: OwnedFd = open(path.as_ref(), flags, Mode::RUSR.union(Mode::WUSR))?;
Copy link
Copy Markdown
Contributor

@oech3 oech3 May 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ERROR: `cspell`: Unknown word 'WUSR'
ERROR: `cspell`: Unknown word 'RUSR'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to tell me :)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

GNU testsuite comparison:

GNU test failed: tests/misc/tty-eof. tests/misc/tty-eof is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/follow-name (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/tail-n0f (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/rm/many-dir-entries-vs-OOM is now being skipped but was previously passing.

`Mode::from_bits_truncate(DEST_INITIAL_MODE)` failed to build on macOS
because `mode_t` is `u16` there but `u32` on Linux. Compose the mode
from `Mode::RUSR | Mode::WUSR` so the call is portable by construction
and self-documents the intent (read+write owner = 0o600).
@sylvestre sylvestre marked this pull request as ready for review May 4, 2026 07:41
@sylvestre sylvestre merged commit 0b6a2f2 into uutils:main May 4, 2026
166 of 167 checks passed
@sylvestre sylvestre deleted the unbreak-safe branch May 4, 2026 08:12
nonontb pushed a commit to nonontb/coreutils that referenced this pull request May 28, 2026
uutils#12140)

`Mode::from_bits_truncate(DEST_INITIAL_MODE)` failed to build on macOS
because `mode_t` is `u16` there but `u32` on Linux. Compose the mode
from `Mode::RUSR | Mode::WUSR` so the call is portable by construction
and self-documents the intent (read+write owner = 0o600).
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.

2 participants