Skip to content
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

treefile: Port tests away from openat #3847

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

cgwalters
Copy link
Member

I switched things to just use std::fs::write() because porting
to cap-std isn't really important or worth it here.

I switched things to just use `std::fs::write()` because porting
to cap-std isn't really important or worth it here.
@jmarrero
Copy link
Member

jmarrero commented Jul 13, 2022

Are we gaining anything from not using cap-std? I would say there is some value of having us use cap-std across the repo for consistency, also it helps when looking for examples of "where have we done this before".

@cgwalters
Copy link
Member Author

Well...we have a ton of code that isn't capability based. We're not going to rewrite everything; and also, not all code is equally critical. This specific code is just used in tests.

And where I hope we will go (as alluded to in a few PRs) is to split rpm-ostree into separate processes; specifically, I think if we can move all the libdnf stuff to a (lesser privileged) subprocess that'd be a gigantic win.

Today in this case it's the libdnf APIs only operating on path strings that blocks the treefile code from using cap-std.

But, if we end up forking it into an entirely separate process, then...well, that problem actually doesn't go away but we can hackily pass it the data it needs by going back to the /proc/self/fd/N route.

What's a bit more important to me actually is to stop depending on the openat crate since it's not really maintained anymore and has some non-obvious traps and pitfalls.

@jmarrero
Copy link
Member

thanks for explaining this, it puts everything in perspective.

Copy link
Member

@jmarrero jmarrero left a comment

Choose a reason for hiding this comment

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

lgtm

@jmarrero jmarrero merged commit 8ddf5f4 into coreos:main Jul 14, 2022
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