Repository navigation
docs(sandboxes): document file read refusal codes #237
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -584,6 +584,17 @@ run as the session user, so a write into a directory that user cannot write retu | |
| `409` with code `sandbox_path_conflict`. Files survive suspend/resume and are removed with | ||
| the session. | ||
|
|
||
| A read of a path with no file returns `404` with code `sandbox_file_not_found`. | ||
| A directory, symbolic link, socket, or other special file at the path returns | ||
| `400` with code `sandbox_file_unreadable`, as does a file the session user can't | ||
| read and, in a cloud session, a file another user owns or one with more than one | ||
| hard link. Copy such a file to a new one with an exec command, then read the | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 P2: Scope the copy workaround to files the session user can read The preceding list includes files the session user cannot read, but exec commands run as that same user, so copying those files also fails with a permission error. Copying a directory or socket likewise does not produce readable regular-file content. Restrict this workaround to readable file content and provide separate guidance for permission failures and non-file paths. Found by gpt-6.1-sol |
||
| copy. A file larger than 8 MiB | ||
| returns `413` with code `sandbox_file_too_large`. A session from an image built | ||
| before these codes, such as a custom template not redeployed since, returns | ||
| `503` instead; start a new session from a current preset, or redeploy the | ||
| template. | ||
|
|
||
| ### Upload a directory as a tar archive | ||
|
|
||
| Create a file archive to write a whole tree in one request. Send | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚪ P3: "Copy such a file with an exec command" can't work for an unreadable file, a directory, or a socket
The paragraph lists several cases: directories, symbolic links, sockets and other special files, a file the session user can't read, and (in a cloud session) a file another user owns or one with more than one hard link. It then says "Copy such a file to a new one with an exec command, then read the copy." Line 580 says exec commands run as the session user. So
cpfails with permission denied on a file that user can't read, and copying a directory or socket doesn't produce a regular file to read. The advice only works for the readable cases: a file another user owns, a file with more than one hard link, and a symlink to a regular file. Fix: say which cases the copy advice is for, for example "Copy a file another user owns or one with more than one hard link…". For a file the session user owns with its read bit clear, suggestchmod u+r.Found by claude-opus-5-5