You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6a263be
Browse filesBrowse the repository at this point in the historyBrowse files
fix(fs): allow open, seek and fstat in the write permission sets (#3630)
* fix(fs): allow open, seek and fstat in the write permission sets
The stream path of writeFile calls `open`, which only the nested command
list of `allow-write-file` granted (plugins/fs/permissions/write-all.toml,
write-files.toml), so `fs:allow-appdata-write-recursive` and the other
write sets rejected streamed writes; seek/fstat were missing for
FileHandles created under these sets.
Adds open, seek and fstat to write-all and write-files. This widens the
write sets slightly (open is already implied by allow-write-file); the
generated reference does not list set members, so nothing to regenerate.
* use dependencies instead
The `write-all` and `write-files` permissions (and so every `allow-*-write[-recursive]` set) are now sets of the `allow-*` command permissions, so they also allow the commands a command depends on. `writeFile` with a `ReadableStream` uses `open` and failed with "not allowed" under these sets.
Copy file name to clipboardExpand all lines: plugins/fs/permissions/schemas/schema.json
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -2035,16 +2035,16 @@
2035
2035
"markdownDescription": "An empty permission you can use to modify the global scope.\n\n## Example\n\n```json\n{\n\"identifier\": \"read-documents\",\n\"windows\": [\"main\"],\n\"permissions\": [\n\"fs:allow-read\",\n {\n\"identifier\": \"fs:scope\",\n\"allow\": [\n\"$APPDATA/documents/**/*\"\n ],\n\"deny\": [\n\"$APPDATA/documents/secret.txt\"\n ]\n }\n ]\n}\n```\n"
2036
2036
},
2037
2037
{
2038
-
"description": "This enables all write related commands without any pre-configured accessible paths.",
2038
+
"description": "This enables all write related commands without any pre-configured accessible paths.\n#### This permission set includes:\n\n- `allow-mkdir`\n- `allow-create`\n- `allow-copy-file`\n- `allow-remove`\n- `allow-rename`\n- `allow-truncate`\n- `allow-ftruncate`\n- `allow-write`\n- `allow-write-file`\n- `allow-write-text-file`",
2039
2039
"type": "string",
2040
2040
"const": "write-all",
2041
-
"markdownDescription": "This enables all write related commands without any pre-configured accessible paths."
2041
+
"markdownDescription": "This enables all write related commands without any pre-configured accessible paths.\n#### This permission set includes:\n\n- `allow-mkdir`\n- `allow-create`\n- `allow-copy-file`\n- `allow-remove`\n- `allow-rename`\n- `allow-truncate`\n- `allow-ftruncate`\n- `allow-write`\n- `allow-write-file`\n- `allow-write-text-file`"
2042
2042
},
2043
2043
{
2044
-
"description": "This enables all file write related commands without any pre-configured accessible paths.",
2044
+
"description": "This enables all file write related commands without any pre-configured accessible paths.\n#### This permission set includes:\n\n- `allow-create`\n- `allow-copy-file`\n- `allow-remove`\n- `allow-rename`\n- `allow-truncate`\n- `allow-ftruncate`\n- `allow-write`\n- `allow-write-file`\n- `allow-write-text-file`",
2045
2045
"type": "string",
2046
2046
"const": "write-files",
2047
-
"markdownDescription": "This enables all file write related commands without any pre-configured accessible paths."
2047
+
"markdownDescription": "This enables all file write related commands without any pre-configured accessible paths.\n#### This permission set includes:\n\n- `allow-create`\n- `allow-copy-file`\n- `allow-remove`\n- `allow-rename`\n- `allow-truncate`\n- `allow-ftruncate`\n- `allow-write`\n- `allow-write-file`\n- `allow-write-text-file`"
0 commit comments