@@ -221,6 +221,7 @@ This section has been adapted from the official WASI API documentation.
221
221
- [ ` uvwasi_fd_filestat_get() ` ] ( #fd_filestat_get )
222
222
- [ ` uvwasi_fd_filestat_set_size() ` ] ( #fd_filestat_set_size )
223
223
- [ ` uvwasi_fd_filestat_set_times() ` ] ( #fd_filestat_set_times )
224
+ - [ ` uvwasi_fd_permissions_set() ` ] ( #fd_permissions_set )
224
225
- [ ` uvwasi_fd_pread() ` ] ( #fd_pread )
225
226
- [ ` uvwasi_fd_prestat_get() ` ] ( #fd_prestat_get )
226
227
- [ ` uvwasi_fd_prestat_dir_name() ` ] ( #fd_prestat_dir_name )
@@ -237,6 +238,7 @@ This section has been adapted from the official WASI API documentation.
237
238
- [ ` uvwasi_path_filestat_set_times() ` ] ( #path_filestat_set_times )
238
239
- [ ` uvwasi_path_link() ` ] ( #path_link )
239
240
- [ ` uvwasi_path_open() ` ] ( #path_open )
241
+ - [ ` uvwasi_path_permissions_set() ` ] ( #path_permissions_set )
240
242
- [ ` uvwasi_path_readlink() ` ] ( #path_readlink )
241
243
- [ ` uvwasi_path_remove_directory() ` ] ( #path_remove_directory )
242
244
- [ ` uvwasi_path_rename() ` ] ( #path_rename )
@@ -531,6 +533,27 @@ Inputs:
531
533
532
534
A bitmask indicating which timestamps to adjust.
533
535
536
+ ### <a href =" #fd_permissions_set " name =" fd_permissions_set " ></a >` uvwasi_fd_permissions_set() `
537
+
538
+ Set the permissions of a file or directory.
539
+
540
+ This sets the permissions associated with a file or directory
541
+ in a filesystem at the time it is called. The ability to actually
542
+ access a file or directory may depend on additional permissions not
543
+ reflected here.
544
+
545
+ Note: This is similar ` fchmod ` in POSIX.
546
+
547
+ Inputs:
548
+
549
+ - <a href =" #fd_permissions_set.fd " name =" fd_permissions_set.fd " ></a ><code >[ \_\_ wasi\_ fd\_ t] ( #fd ) <strong >fd</strong ></code >
550
+
551
+ The file descriptor to operate on.
552
+
553
+ - <a href =" #fd_permissions_set.permissions " name =" fd_permissions_set.permissions " ></a ><code >[ \_\_ wasi\_ permissions\_ t] ( #permissions ) <strong >permissions</strong ></code >
554
+
555
+ The permissions associated with the file.
556
+
534
557
### <a href =" #fd_pread " name =" fd_pread " ></a >` uvwasi_fd_pread() `
535
558
536
559
Read from a file descriptor, without using and updating the
@@ -927,13 +950,50 @@ Inputs:
927
950
928
951
The initial flags of the file descriptor.
929
952
953
+ - <a href =" #path_open.permissions " name =" path_open.permissions " ></a ><code >[ \_\_ wasi\_ permissions\_ t] ( #permissions ) <strong >permissions</strong ></code >
954
+
955
+ If a file is created, the filesystem permissions to associate with it.
956
+
930
957
Outputs:
931
958
932
959
- <a href =" #path_open.fd " name =" path_open.fd " ></a ><code >[ \_\_ wasi\_ fd\_ t] ( #fd ) <strong >fd</strong ></code >
933
960
934
961
The file descriptor of the file that has been
935
962
opened.
936
963
964
+ ### <a href =" #path_permissions_set " name =" path_permissions_set " ></a >` uvwasi_path_permissions_set() `
965
+
966
+ Set the permissions of a file or directory.
967
+
968
+ This sets the permissions associated with a file or directory in a
969
+ filesystem at the time it is called. The ability to actually access
970
+ a file or directory may depend on additional permissions not reflected
971
+ here.
972
+
973
+ Note: This is similar ` fchmodat ` in POSIX.
974
+
975
+ Unlike POSIX, this doesn't expose a user/group/other distinction;
976
+ implementations in POSIX environments are suggested to consult the
977
+ umask to determine which of the user/group/other flags to modify.
978
+
979
+ Inputs:
980
+
981
+ - <a href =" #path_permissions_set.fd " name =" path_permissions_set.fd " ></a ><code >[ \_\_ wasi\_ fd\_ t] ( #fd ) <strong >fd</strong ></code >
982
+
983
+ The file descriptor to operate on.
984
+
985
+ - <a href =" #path_permissions_set.flags " name =" path_permissions_set.flags " ></a ><code >[ \_\_ wasi\_ lookupflags\_ t] ( #lookupflags ) <strong >flags</strong ></code >
986
+
987
+ Flags determining the method of how the path is resolved.
988
+
989
+ - <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 >
990
+
991
+ The path to a file to query.
992
+
993
+ - <a href =" #path_permissions_set.permissions " name =" path_permissions_set.permissions " ></a ><code >[ \_\_ wasi\_ permissions\_ t] ( #permissions ) <strong >permissions</strong ></code >
994
+
995
+ The permissions associated with the file.
996
+
937
997
### <a href =" #path_readlink " name =" path_readlink " ></a >` uvwasi_path_readlink() `
938
998
939
999
Read the contents of a symbolic link.
@@ -1809,6 +1869,10 @@ Members:
1809
1869
1810
1870
File type.
1811
1871
1872
+ - <a href =" #filestat.permissions " name =" filestat.permissions " ></a ><code >[ \_\_ wasi\_ permissions\_ t] ( #permissions ) <strong >permissions</strong ></code >
1873
+
1874
+ File permissions.
1875
+
1812
1876
- <a href =" #filestat.st_nlink " name =" filestat.st_nlink " ></a ><code >[ \_\_ wasi\_ linkcount\_ t] ( #linkcount ) <strong >st\_ nlink</strong ></code >
1813
1877
1814
1878
Number of hard links to the file.
@@ -1971,6 +2035,30 @@ Possible values:
1971
2035
1972
2036
Truncate file to size 0.
1973
2037
2038
+ ### <a href =" #permissions " name =" permissions " ></a >` uvwasi_permissions_t ` (` uint8_t ` bitfield)
2039
+
2040
+ 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.
2041
+
2042
+ Possible values:
2043
+
2044
+ - <a href =" #permissions.read " name =" permissions.read " ></a >** ` UVWASI_PERMISSION_READ ` **
2045
+
2046
+ For files, permission to read the file. For directories, permission to do ` readdir ` and access files within the directory.
2047
+
2048
+ Note: This is similar to the read bit being set on files, and the read * and* execute bits being set on directories, in POSIX.
2049
+
2050
+ - <a href =" #permissions.write " name =" permissions.write " ></a >** ` UVWASI_PERMISSION_WRITE ` **
2051
+
2052
+ For files, permission to mutate the file. For directories, permission to create, remove, and rename items within the directory.
2053
+
2054
+ - <a href =" #permissions.execute " name =" permissions.execute " ></a >** ` UVWASI_PERMISSION_EXECUTE ` **
2055
+
2056
+ For files, permission to "execute" the file, using whatever concept of "executing" the host filesystem has. This flag is not valid for directories.
2057
+
2058
+ - <a href =" #permissions.private " name =" permissions.private " ></a >** ` UVWASI_PERMISSION_PRIVATE ` **
2059
+
2060
+ 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".
2061
+
1974
2062
### <a href =" #riflags " name =" riflags " ></a >` uvwasi_riflags_t ` (` uint16_t ` bitfield)
1975
2063
1976
2064
Flags provided to [ ` uvwasi_sock_recv() ` ] ( #sock_recv ) .
@@ -2106,6 +2194,10 @@ Possible values:
2106
2194
2107
2195
The right to invoke [ ` uvwasi_path_filestat_set_times() ` ] ( #path_filestat_set_times ) .
2108
2196
2197
+ - <a href =" #rights.path_permissions_set " name =" rights.path_permissions_set " ></a >** ` UVWASI_RIGHT_PATH_PERMISSIONS_SET ` **
2198
+
2199
+ The right to invoke [ ` uvwasi_path_filestat_permissions_set() ` ] ( #path_filestat_permissions_set ) .
2200
+
2109
2201
- <a href =" #rights.fd_filestat_get " name =" rights.fd_filestat_get " ></a >** ` UVWASI_RIGHT_FD_FILESTAT_GET ` **
2110
2202
2111
2203
The right to invoke [ ` uvwasi_fd_filestat_get() ` ] ( #fd_filestat_get ) .
@@ -2118,6 +2210,10 @@ Possible values:
2118
2210
2119
2211
The right to invoke [ ` uvwasi_fd_filestat_set_times() ` ] ( #fd_filestat_set_times ) .
2120
2212
2213
+ - <a href =" #rights.fd_permissions_set " name =" rights.fd_permissions_set " ></a >** ` UVWASI_RIGHT_FD_PERMISSIONS_SET ` **
2214
+
2215
+ The right to invoke [ ` uvwasi_fd_filestat_permissions_set() ` ] ( #fd_filestat_permissions_set ) .
2216
+
2121
2217
- <a href =" #rights.path_symlink " name =" rights.path_symlink " ></a >** ` UVWASI_RIGHT_PATH_SYMLINK ` **
2122
2218
2123
2219
The right to invoke [ ` uvwasi_path_symlink() ` ] ( #path_symlink ) .
0 commit comments