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

basedir #2

Open
konsumer opened this issue Oct 30, 2024 · 2 comments
Open

basedir #2

konsumer opened this issue Oct 30, 2024 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@konsumer
Copy link
Owner

konsumer commented Oct 30, 2024

Since we can't really control that / is root, and it's memfs in zenfs, it would be cool to be able to sort of "chroot" (lock access to a specific directory.) This would allow mounting /zip then switching / to /zip, so /cyber.txt is a file inside the zip.

I think this could be done by translating any directories to prepend this.rootDir and then allow setting that.

Normally, I would make sure that users can't do things like /somedir/../../.., but for this case it's not really important. It's sort of a "light sandbox" since you can just not mount things you don't want the user to access, still maybe a "nice to have" to make sure it can't access anything outside of /.

@konsumer konsumer added enhancement New feature or request help wanted Extra attention is needed labels Oct 30, 2024
@konsumer
Copy link
Owner Author

konsumer commented Nov 4, 2024

This may be resolved with discussion at zen-fs#124

@konsumer
Copy link
Owner Author

I may just make my own fs-like to handle this. I have already been using emscripten's FS directly, to provide fs for another WASI (shared only between the 2, but not other instances) and it works fine. filer is also maybe a better fit, since it does not use a global fs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant