@@ -213,6 +213,7 @@ This section has been adapted from the official WASI API documentation.
213
213
- [ ` uvwasi_fd_filestat_get() ` ] ( #fd_filestat_get )
214
214
- [ ` uvwasi_fd_filestat_set_size() ` ] ( #fd_filestat_set_size )
215
215
- [ ` uvwasi_fd_filestat_set_times() ` ] ( #fd_filestat_set_times )
216
+ - [ ` uvwasi_fd_permissions_set() ` ] ( #fd_permissions_set )
216
217
- [ ` uvwasi_fd_pread() ` ] ( #fd_pread )
217
218
- [ ` uvwasi_fd_prestat_get() ` ] ( #fd_prestat_get )
218
219
- [ ` uvwasi_fd_prestat_dir_name() ` ] ( #fd_prestat_dir_name )
@@ -229,6 +230,7 @@ This section has been adapted from the official WASI API documentation.
229
230
- [ ` uvwasi_path_filestat_set_times() ` ] ( #path_filestat_set_times )
230
231
- [ ` uvwasi_path_link() ` ] ( #path_link )
231
232
- [ ` uvwasi_path_open() ` ] ( #path_open )
233
+ - [ ` uvwasi_path_permissions_set() ` ] ( #path_permissions_set )
232
234
- [ ` uvwasi_path_readlink() ` ] ( #path_readlink )
233
235
- [ ` uvwasi_path_remove_directory() ` ] ( #path_remove_directory )
234
236
- [ ` uvwasi_path_rename() ` ] ( #path_rename )
@@ -523,6 +525,27 @@ Inputs:
523
525
524
526
A bitmask indicating which timestamps to adjust.
525
527
528
+ ### <a href =" #fd_permissions_set " name =" fd_permissions_set " ></a >` uvwasi_fd_permissions_set() `
529
+
530
+ Set the permissions of a file or directory.
531
+
532
+ This sets the permissions associated with a file or directory
533
+ in a filesystem at the time it is called. The ability to actually
534
+ access a file or directory may depend on additional permissions not
535
+ reflected here.
536
+
537
+ Note: This is similar ` fchmod ` in POSIX.
538
+
539
+ Inputs:
540
+
541
+ - <a href =" #fd_permissions_set.fd " name =" fd_permissions_set.fd " ></a ><code >[ \_\_ wasi\_ fd\_ t] ( #fd ) <strong >fd</strong ></code >
542
+
543
+ The file descriptor to operate on.
544
+
545
+ - <a href =" #fd_permissions_set.permissions " name =" fd_permissions_set.permissions " ></a ><code >[ \_\_ wasi\_ permissions\_ t] ( #permissions ) <strong >permissions</strong ></code >
546
+
547
+ The permissions associated with the file.
548
+
526
549
### <a href =" #fd_pread " name =" fd_pread " ></a >` uvwasi_fd_pread() `
527
550
528
551
Read from a file descriptor, without using and updating the
@@ -919,13 +942,50 @@ Inputs:
919
942
920
943
The initial flags of the file descriptor.
921
944
945
+ - <a href =" #path_open.permissions " name =" path_open.permissions " ></a ><code >[ \_\_ wasi\_ permissions\_ t] ( #permissions ) <strong >permissions</strong ></code >
946
+
947
+ If a file is created, the filesystem permissions to associate with it.
948
+
922
949
Outputs:
923
950
924
951
- <a href =" #path_open.fd " name =" path_open.fd " ></a ><code >[ \_\_ wasi\_ fd\_ t] ( #fd ) <strong >fd</strong ></code >
925
952
926
953
The file descriptor of the file that has been
927
954
opened.
928
955
956
+ ### <a href =" #path_permissions_set " name =" path_permissions_set " ></a >` uvwasi_path_permissions_set() `
957
+
958
+ Set the permissions of a file or directory.
959
+
960
+ This sets the permissions associated with a file or directory in a
961
+ filesystem at the time it is called. The ability to actually access
962
+ a file or directory may depend on additional permissions not reflected
963
+ here.
964
+
965
+ Note: This is similar ` fchmodat ` in POSIX.
966
+
967
+ Unlike POSIX, this doesn't expose a user/group/other distinction;
968
+ implementations in POSIX environments are suggested to consult the
969
+ umask to determine which of the user/group/other flags to modify.
970
+
971
+ Inputs:
972
+
973
+ - <a href =" #path_permissions_set.fd " name =" path_permissions_set.fd " ></a ><code >[ \_\_ wasi\_ fd\_ t] ( #fd ) <strong >fd</strong ></code >
974
+
975
+ The file descriptor to operate on.
976
+
977
+ - <a href =" #path_permissions_set.flags " name =" path_permissions_set.flags " ></a ><code >[ \_\_ wasi\_ lookupflags\_ t] ( #lookupflags ) <strong >flags</strong ></code >
978
+
979
+ Flags determining the method of how the path is resolved.
980
+
981
+ - <a href =" #path_permissions_set.path " name =" path_permissions_set.path " ></a ><code >const char \* <strong >path</strong ></code > and <a href =" #path_permissions_set.path_len " name =" path_permissions_set.path_len " ></a ><code >size\_ t <strong >path\_ len</strong ></code >
982
+
983
+ The path to a file to query.
984
+
985
+ - <a href =" #path_permissions_set.permissions " name =" path_permissions_set.permissions " ></a ><code >[ \_\_ wasi\_ permissions\_ t] ( #permissions ) <strong >permissions</strong ></code >
986
+
987
+ The permissions associated with the file.
988
+
929
989
### <a href =" #path_readlink " name =" path_readlink " ></a >` uvwasi_path_readlink() `
930
990
931
991
Read the contents of a symbolic link.
@@ -1801,6 +1861,10 @@ Members:
1801
1861
1802
1862
File type.
1803
1863
1864
+ - <a href =" #filestat.permissions " name =" filestat.permissions " ></a ><code >[ \_\_ wasi\_ permissions\_ t] ( #permissions ) <strong >permissions</strong ></code >
1865
+
1866
+ File permissions.
1867
+
1804
1868
- <a href =" #filestat.st_nlink " name =" filestat.st_nlink " ></a ><code >[ \_\_ wasi\_ linkcount\_ t] ( #linkcount ) <strong >st\_ nlink</strong ></code >
1805
1869
1806
1870
Number of hard links to the file.
@@ -1963,6 +2027,30 @@ Possible values:
1963
2027
1964
2028
Truncate file to size 0.
1965
2029
2030
+ ### <a href =" #permissions " name =" permissions " ></a >` uvwasi_permissions_t ` (` uint8_t ` bitfield)
2031
+
2032
+ File permissions. This represents the permissions associated with a file in a filesystem, and don't fully reflect all the conditions which determine whether a given WASI program can access the file.
2033
+
2034
+ Possible values:
2035
+
2036
+ - <a href =" #permissions.read " name =" permissions.read " ></a >** ` UVWASI_PERMISSION_READ ` **
2037
+
2038
+ For files, permission to read the file. For directories, permission to do ` readdir ` and access files within the directory.
2039
+
2040
+ Note: This is similar to the read bit being set on files, and the read * and* execute bits being set on directories, in POSIX.
2041
+
2042
+ - <a href =" #permissions.write " name =" permissions.write " ></a >** ` UVWASI_PERMISSION_WRITE ` **
2043
+
2044
+ For files, permission to mutate the file. For directories, permission to create, remove, and rename items within the directory.
2045
+
2046
+ - <a href =" #permissions.execute " name =" permissions.execute " ></a >** ` UVWASI_PERMISSION_EXECUTE ` **
2047
+
2048
+ For files, permission to "execute" the file, using whatever concept of "executing" the host filesystem has. This flag is not valid for directories.
2049
+
2050
+ - <a href =" #permissions.private " name =" permissions.private " ></a >** ` UVWASI_PERMISSION_PRIVATE ` **
2051
+
2052
+ For filesystems which have a concept of multiple "users", this flag indicates that the file is only accessible by the effective "user" that the WASI store uses to access the filesystem, and inaccessible to other "users".
2053
+
1966
2054
### <a href =" #riflags " name =" riflags " ></a >` uvwasi_riflags_t ` (` uint16_t ` bitfield)
1967
2055
1968
2056
Flags provided to [ ` uvwasi_sock_recv() ` ] ( #sock_recv ) .
@@ -2098,6 +2186,10 @@ Possible values:
2098
2186
2099
2187
The right to invoke [ ` uvwasi_path_filestat_set_times() ` ] ( #path_filestat_set_times ) .
2100
2188
2189
+ - <a href =" #rights.path_permissions_set " name =" rights.path_permissions_set " ></a >** ` UVWASI_RIGHT_PATH_PERMISSIONS_SET ` **
2190
+
2191
+ The right to invoke [ ` uvwasi_path_filestat_permissions_set() ` ] ( #path_filestat_permissions_set ) .
2192
+
2101
2193
- <a href =" #rights.fd_filestat_get " name =" rights.fd_filestat_get " ></a >** ` UVWASI_RIGHT_FD_FILESTAT_GET ` **
2102
2194
2103
2195
The right to invoke [ ` uvwasi_fd_filestat_get() ` ] ( #fd_filestat_get ) .
@@ -2110,6 +2202,10 @@ Possible values:
2110
2202
2111
2203
The right to invoke [ ` uvwasi_fd_filestat_set_times() ` ] ( #fd_filestat_set_times ) .
2112
2204
2205
+ - <a href =" #rights.fd_permissions_set " name =" rights.fd_permissions_set " ></a >** ` UVWASI_RIGHT_FD_PERMISSIONS_SET ` **
2206
+
2207
+ The right to invoke [ ` uvwasi_fd_filestat_permissions_set() ` ] ( #fd_filestat_permissions_set ) .
2208
+
2113
2209
- <a href =" #rights.path_symlink " name =" rights.path_symlink " ></a >** ` UVWASI_RIGHT_PATH_SYMLINK ` **
2114
2210
2115
2211
The right to invoke [ ` uvwasi_path_symlink() ` ] ( #path_symlink ) .
0 commit comments