Skip to content

uucore: fix correct mkdirat implementation to use nix crate's mkdirat function#11126

Merged
sylvestre merged 1 commit intouutils:mainfrom
mattsu2020:safe_traversal
Feb 26, 2026
Merged

uucore: fix correct mkdirat implementation to use nix crate's mkdirat function#11126
sylvestre merged 1 commit intouutils:mainfrom
mattsu2020:safe_traversal

Conversation

@mattsu2020
Copy link
Copy Markdown
Contributor

The commit fixes an issue where the mkdir_at method was incorrectly using the raw libc mkdirat function instead of the nix crate's mkdirat function. This change ensures proper error handling and type safety by using the nix crate's wrapper, which provides better integration with Rust's type system and error handling patterns.

The commit fixes an issue where the `mkdir_at` method was incorrectly using the raw libc `mkdirat` function instead of the nix crate's `mkdirat` function. This change ensures proper error handling and type safety by using the nix crate's wrapper, which provides better integration with Rust's type system and error handling patterns.
@sylvestre
Copy link
Copy Markdown
Contributor

what was the impact for users?

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skip an intermittent issue tests/tail/symlink (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/follow-name (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/tail/retry is no longer failing!
Note: The gnu test tests/dd/no-allocate is now being skipped but was previously passing.
Congrats! The gnu test tests/cut/cut-huge-range is now passing!
Congrats! The gnu test tests/tail/tail-n0f is now passing!

@mattsu2020
Copy link
Copy Markdown
Contributor Author

what was the impact for users?

No end-user behavioral change is intended.
This is an internal refactor replacing direct libc calls with nix wrappers.
CLI behavior, output, and exit codes remain the same.
The main impact is reduced unsafe surface and improved maintainability.

@sylvestre
Copy link
Copy Markdown
Contributor

mkdir_at method was incorrectly using the raw libc mkdirat function instead of the nix crate's mkdirat function

I was confused by the "incorrectly" :)

@sylvestre sylvestre merged commit d437fe4 into uutils:main Feb 26, 2026
200 of 213 checks passed
@mattsu2020 mattsu2020 deleted the safe_traversal branch February 26, 2026 13:20
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