Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add fakeroot - combined mount and chroot to create a docker-like view on the filesystem#36

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MarkusBauer wants to merge3 commits intotailhook:master
base:master
Choose a base branch
Loading
fromMarkusBauer:feature-fakeroot

Conversation

@MarkusBauer
Copy link

@MarkusBauerMarkusBauer commentedMar 1, 2025
edited
Loading

While this project already has support for chroot and pivot_root, these features are hardly useful if you want to start anything else than a static linked binary. Thus I added a more powerful feature: fakeroots.

A fakeroot is an initially empty root, where directories from the host can be selectively shared. Shares can be read-only if necessary, providing additional isolation. For example, this code allows read-only access to installed programs but not user data and no write access at all:

cmd.fakeroot_enable("/dev/shm/sandbox_root");cmd.fakeroot_mount("/bin","/bin",true);// add directoriescmd.fakeroot_mount_file("/dev/urandom","/dev/urandom",false);// add files/devicescmd.fakeroot_mount("/etc","/etc",true);cmd.fakeroot_mount("/lib","/lib",true);cmd.fakeroot_mount("/lib64","/lib64",true);cmd.fakeroot_filesystem("proc","/proc");// add custom filesystems (proc or tmpfs)cmd.fakeroot_filesystem("tmpfs","/tmp");cmd.fakeroot_mount("/usr","/usr",true);

The implementation is mostly inspired bynsjail which uses the same syscall sequence.
Supported are: directories, files, devices, and custom filesystems likeproc ortmp.


Availability: If anyone wants to use this and other features before it's merged, check outmy temporary fork. It includes#23#27#29#33#34#35 and#36 with all conflicts resolved.
Add to yourCargo.toml:unshare = { git = "https://github.com/MarkusBauer/unshare.git" }

Markus Bauer added3 commitsMarch 1, 2025 14:57
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@MarkusBauer

[8]ページ先頭

©2009-2025 Movatter.jp