-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revive RFC: Change Process to use directory fd #171
Conversation
All data accessors now use openat and readlinkat when reading procfs entries, to prevent PID reuse. Co-authored-by: Jason Francis <zxzax@protonmail.com>
Hey, this is pretty neat, thanks for the PR. There's a lot to unpack (and to review) here, so please bear with me... I took a quick skim and despite the large diff, everything is pretty readable. But I do want to spend some more time looking at all the changes. A few brief comments for now:
|
These are implementation details that don't need to be part of the public API.
This avoids exposing `rustix::fs::Stat` in the public API, and makes the main obvious use case simpler.
This hides the use of `BorrowedFd` to hold a procfs directory file descriptor from the public API.
This `impl` is visible in the public API, so hide it, and just manually convert error types as needed.
This takes the rustix `RawMode` type out of the public API, and it uses fewer bits.
Some of those things were APIs which don't actually need to be public, and others were things that could be avoided. I've now fixed them, so rustix doesn't appear in the public API at all. |
Thanks, I appreciate that |
Is there anything else you'd like to see in this PR? |
No, sorry for my delinquency here. I did spend some time trying to update a project to using this new version, and I will say that the fact that But that of course doesn't need to help up this PR. One final question for you: How closely should I be following |
Yeah, 0.34.0 should be good for a while. There will likely be a 0.35 at some point over the next few months, to synchronize rustix with the io_safety API in Rust as it stabilizes, but I'm expecting to backport any important bug fixes to 0.34 point releases. |
It apppears I accidentally removed `all_processes_with_root` in eminence#171. This PR reintroduces it.
This fixes a regression that was introduced in eminence#171 Closes eminence#197
This fixes a regression that was introduced in eminence#171 Closes eminence#197
This updates and polishes the patch from #127, which seems to be abandoned, as the author is listed as @ghost. It uses
openat
andreadlinkat
to protect against PID reuse.This also makes two additional changes: it adds a dependency on rustix, which provides safe APIs for
openat
,readlinkat
, and so on, and it bumps the MSRV to 1.48. I know you just recently bumped the MSRV to 1.42, but 1.48 is worth considering, as it's the version of Rust currently in Debian stable, it's newer than the version in the oldest still-supported Fedora release, and it eliminates the need for special instructions for the hex and bitflags dependencies. That said, people have different needs, and of course it's your call as to whether these changes are appropriate for procfs.Fixes #125.