Skip to content

uucore: remove unsafe make_fifo#12243

Merged
sylvestre merged 1 commit into
uutils:mainfrom
oech3:makefifo
May 16, 2026
Merged

uucore: remove unsafe make_fifo#12243
sylvestre merged 1 commit into
uutils:mainfrom
oech3:makefifo

Conversation

@oech3
Copy link
Copy Markdown
Contributor

@oech3 oech3 commented May 11, 2026

@oech3 oech3 force-pushed the makefifo branch 2 times, most recently from 9c35983 to 7ee1124 Compare May 11, 2026 19:00
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (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/printf/printf-surprise is now passing!
Congrats! The gnu test tests/seq/seq-epipe is now passing!

@oech3 oech3 marked this pull request as ready for review May 11, 2026 19:25
Comment thread src/uu/mv/Cargo.toml
fs_extra = { workspace = true }
indicatif = { workspace = true }
libc = { workspace = true }
nix = { workspace = true }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

as we discussed earlier, I would like to avoid having rustix, libc and nix.
can we avoid this here? thanks

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.

rustix::fs::mkfifoat is missing macos and redox support currently.
I can use it for SELinux specific *.rs.

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.

It seems libc is used just for const. Ith might be able to remove one.

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.

@xtqqczze
Copy link
Copy Markdown
Contributor

xtqqczze commented May 11, 2026

uucore::fs::make_fifo is a public API, it doesn't seem to be used in other external crates though.

@sylvestre sylvestre merged commit 9e3ab20 into uutils:main May 16, 2026
171 checks passed
// Create a FIFO (pipe)
let fifo_path = dir_path.join("my_fifo");
crate::fs::make_fifo(&fifo_path).expect("Failed to create FIFO");
// todo: use rustix::fs::mkfifoat since selinux is linux specific
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, rustix::fs::mkfifoat would be best. However, since tempfile::TempDir does not provide a handle to the directory, it's not feasible.

@oech3 oech3 deleted the makefifo branch May 17, 2026 00:22
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.

3 participants