Skip to content
This repository was archived by the owner on Nov 25, 2025. It is now read-only.
This repository was archived by the owner on Nov 25, 2025. It is now read-only.

Remove the rights system #31

Description

@sunfishcode

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.

Activity

  1. linclark commented on Apr 13, 2021

    @linclark
    Member

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

  2. added a commit that references this issue on May 11, 2021
  3. sunfishcode commented on May 11, 2021

    @sunfishcode
    MemberAuthor

    I've now created #32 to implement this.

  4. sunfishcode commented on Jul 20, 2022

    @sunfishcode
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions