Skip to content

Remove the rights system #31

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

Closed
sunfishcode opened this issue Apr 13, 2021 · 3 comments
Closed

Remove the rights system #31

sunfishcode opened this issue Apr 13, 2021 · 3 comments

Comments

@sunfishcode
Copy link
Member

sunfishcode commented Apr 13, 2021

As has been observed in #28 (comment), #23, #8, and conversations elsewhere, wasi-filesystems rights system is complex to implement, complex to use, and not very valuable in practice. It doesn't reflect anything in POSIX, so it doesn't give us any extra POSIX compatibility. It requires extra code in libc, both in path_open to translate POSIX open flags into rights flags, and to translate from ENOTCAPABLE into POSIX errno values, and we care about code size!

fdstat_t and path_open will need a new value to specifying the file mode, which can be either read, write, or read+write.

fd_fdstat_set_rights will no longer be needed. Note that POSIX doesn't have a way to change the read or write flags on an open file descriptor after it's opened, so this won't remove any POSIX functionality.

Note that, as in POSIX, this would mean that directories must be opened with read (and not write) permissions, and the resulting handle can mutate the filesystem (assuming the filesystem ACLs permit it). As in POSIX, this would mean there's no built in concept of a readonly view of an otherwise writeable filesystem. Such a thing would seem useful, however it's not in POSIX, and it is something that will eventually be implementable with API virtualization, so I'm proposing we just let this be unsupported for now.

@linclark
Copy link
Member

[bookkeeping] Added to the Phase 3: wasi-filesystem project board.

sunfishcode added a commit that referenced this issue May 11, 2021
As discussed in #31, the `rights` type adds significant complexity both
for implementors and users, and isn't needed for POSIX compatibility.

Fixes #31.
@sunfishcode
Copy link
Member Author

I've now created #32 to implement this.

sunfishcode added a commit to sunfishcode/wasi-filesystem that referenced this issue Nov 22, 2021
This makes a number of changes, to make use of interface-types features such
as `expected`, variant types, and resources. The change to use resources in
particular means that filesystem functions are now methods of the `descriptor`
resource. Since this means renaming everything, take this opportunity to
introduce a new naming conventions, with `_at` being used for functions that
take dirfd+path arguments.

This also eliminates the `rights` concept what was present in earlier versions
of WASI, has has discussed in WebAssembly#31. This required adding new flags to `open_at`,
so while here, this also adds basic `chmod`-like support, as discussed in WebAssembly#33.

And, this removes support for readdir seeking (seekdir/telldir), as discussed
in WebAssembly#7.

And it adds a fifo file type and a more general socket type, as discussed in
sunfishcode added a commit to sunfishcode/wasi-filesystem that referenced this issue Nov 22, 2021
This makes a number of changes, to make use of interface-types features such
as `expected`, variant types, and resources. The change to use resources in
particular means that filesystem functions are now methods of the `descriptor`
resource. Since this means renaming everything, take this opportunity to
introduce a new naming conventions, with `_at` being used for functions that
take dirfd+path arguments.

This also eliminates the `rights` concept what was present in earlier versions
of WASI, has has discussed in WebAssembly#31. This required adding new flags to `open_at`,
so while here, this also adds basic `chmod`-like support, as discussed in WebAssembly#33.

And, this removes support for readdir seeking (seekdir/telldir), as discussed
in WebAssembly#7.

And it adds a fifo file type and a more general socket type, as discussed in
sunfishcode added a commit to sunfishcode/wasi-filesystem that referenced this issue Nov 22, 2021
This makes a number of changes, to make use of interface-types features such
as `expected`, variant types, and resources. The change to use resources in
particular means that filesystem functions are now methods of the `descriptor`
resource. Since this means renaming everything, take this opportunity to
introduce a new naming conventions, with `_at` being used for functions that
take dirfd+path arguments.

This also eliminates the `rights` concept what was present in earlier versions
of WASI, has has discussed in WebAssembly#31. This required adding new flags to `open_at`,
so while here, this also adds basic `chmod`-like support, as discussed in WebAssembly#33.

And, this removes support for readdir seeking (seekdir/telldir), as discussed
in WebAssembly#7.

And it adds a fifo file type and a more general socket type, as discussed in
sunfishcode added a commit to sunfishcode/wasi-filesystem that referenced this issue Nov 22, 2021
This makes a number of changes, to make use of interface-types features such
as expected, variant types, and resources. The change to use resources in
particular means that filesystem functions are now methods of the descriptor
resource. Since this means renaming everything, take this opportunity to
introduce a new naming conventions, with _at being used for functions that
take dirfd+path arguments.

This also eliminates the rights concept what was present in earlier versions
of WASI, has has discussed in WebAssembly#31. This required adding new flags to open_at,
so while here, this also adds basic chmod-like support, as discussed in WebAssembly#33.

And, this removes support for readdir seeking (seekdir/telldir), as discussed
in WebAssembly#7.

And it adds a fifo file type and a more general socket type, as discussed in WebAssembly#4.
sunfishcode added a commit that referenced this issue Dec 15, 2021
This makes a number of changes, to make use of interface-types features such
as expected, variant types, and resources. The change to use resources in
particular means that filesystem functions are now methods of the descriptor
resource. Since this means renaming everything, take this opportunity to
introduce a new naming conventions, with _at being used for functions that
take dirfd+path arguments.

This also eliminates the rights concept what was present in earlier versions
of WASI, has has discussed in #31. This required adding new flags to open_at,
so while here, this also adds basic chmod-like support, as discussed in #33.

And, this removes support for readdir seeking (seekdir/telldir), as discussed
in #7.

And it adds a fifo file type and a more general socket type, as discussed in #4.
@sunfishcode
Copy link
Member Author

The rights system is now removed from wasi-filesystem.wit.md.

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 a pull request may close this issue.

2 participants