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

WASI checking real system file system rather than vfs #2745

Open
john-sharratt opened this issue Jan 7, 2022 · 3 comments
Open

WASI checking real system file system rather than vfs #2745

john-sharratt opened this issue Jan 7, 2022 · 3 comments
Labels
bug Something isn't working 📦 lib-vfs About wasmer-vfs 📦 lib-wasi About wasmer-wasi priority-medium Medium priority issue
Milestone

Comments

@john-sharratt
Copy link
Contributor

Describe the bug

It's hard to reproduce without setting up an environment for it however just reading the code the bug is hopefully easy to confirm.

At these lines:

if adjusted_path.exists() && !adjusted_path.is_dir() {

} else if !adjusted_path.exists() {

if o_flags & __WASI_O_EXCL != 0 && path_arg.exists() {

if o_flags & __WASI_O_EXCL != 0 && path.exists() {

The code is checking for things like the existence of files and directories and their type however its doing it in the real file system rather than virtual one because its using the Path helper functions which are in a standard crate.

Expected behavior

Should be using the VFS file system calls rather than using the helper functions of Path which are not connected to the VFS.

Over here is a working version...
john-sharratt@5a7407b

Additional context

Ill patch it in my second merge request that's waiting for the first merge request to merge - if you fix the bug before the other merge request I'll remove it again.

Cheers

@john-sharratt john-sharratt added the bug Something isn't working label Jan 7, 2022
@syrusakbary
Copy link
Member

Good catch!

@Amanieu Amanieu added the priority-medium Medium priority issue label Feb 9, 2022
@stale
Copy link

stale bot commented Feb 10, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale Inactive issues or PR label Feb 10, 2023
@syrusakbary
Copy link
Member

non-stale

@syrusakbary syrusakbary removed the 🏚 stale Inactive issues or PR label Feb 10, 2023
@theduke theduke added the 📦 lib-wasi About wasmer-wasi label Feb 10, 2023
@theduke theduke added this to the v3.2 milestone Feb 10, 2023
@ptitSeb ptitSeb modified the milestones: v3.2, v3.3 Apr 13, 2023
@ptitSeb ptitSeb modified the milestones: v3.3, v4.x Apr 20, 2023
@ptitSeb ptitSeb added the 📦 lib-vfs About wasmer-vfs label Apr 20, 2023
@syrusakbary syrusakbary modified the milestones: v4.x, v4.4-pending Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📦 lib-vfs About wasmer-vfs 📦 lib-wasi About wasmer-wasi priority-medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

6 participants