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

Port root pivoting code from nix to rustix #389

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jplatte
Copy link
Member

@jplatte jplatte commented Jan 5, 2025

Haven't tested it 😅
But it compiles now and I got no more energy for this stuff for today.

add_mount(None, "/", None, MsFlags::MS_REC | MsFlags::MS_PRIVATE)?;
add_mount(Some(root), root, None, MsFlags::MS_BIND)?;
mount_change("/", MountPropagationFlags::REC | MountPropagationFlags::PRIVATE)
.map_err(|source| ContainerError::MountSetPrivate { source })?;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: if you use newtype enum pattern MountSetPrivate(InnerError) you can do

.map_err(ContainerError::MountSetPrivate)

Copy link
Member Author

Choose a reason for hiding this comment

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

I know. I was following the snafu pattern already basically. Do you think I should change it for more consistency with what we already have, for now?

@jplatte jplatte marked this pull request as draft January 9, 2025 22:44
@CLAassistant
Copy link

CLAassistant commented Jan 17, 2025

CLA assistant check
All committers have signed the CLA.

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