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

Openning a file from local folder, when not mounted, should result in error ENOTCAPABLE and no file openned #3264

Closed
ptitSeb opened this issue Oct 27, 2022 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ptitSeb
Copy link
Contributor

ptitSeb commented Oct 27, 2022

With no folder preopenned, openning a file from current folder should result in an error ENOTCAPABLE and no file openned.

here is the code

#include <assert.h>
#include <errno.h>
#include <stdio.h>

int main() {
  FILE* file = fopen("fopen-working-directory.c", "r");
  assert(file == NULL);
  assert(errno == ENOTCAPABLE);

  return 0;
}

fopen-working-directory.zip

And attached the wasm file, that expect to be run with fopen-working-directory.c existing in current folder.

@ptitSeb ptitSeb added the bug Something isn't working label Oct 27, 2022
@ptitSeb ptitSeb added this to the v3.x milestone Oct 27, 2022
@ptitSeb ptitSeb self-assigned this Oct 27, 2022
bors bot added a commit that referenced this issue Nov 3, 2022
3266: Return ENotCapable error when accessing unknown files on root (for #3263 and #3264) r=ptitSeb a=ptitSeb

Fixes for wasm.fyi tests:
 * When accessing bad path from the root, return ENOTCAPABLE error instead of ENOENT (root can only contains pre-openned folder, no other capability)
 * Accessing ROOT for other things then entering folder should result in ENOTCAPABLE


Co-authored-by: ptitSeb <sebastien.chev@gmail.com>
@syrusakbary syrusakbary modified the milestones: v3.x, v3.0 Nov 8, 2022
@syrusakbary
Copy link
Member

This was fixed with #3266

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants