diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-01 05:01:31 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 05:18:09 -0300 |
| commit | 250db41743f77ce3d8421f729bdea0065aa6bc79 (patch) | |
| tree | 906bbefca6d448ba04c81c93cf552e23b5e6c3a4 /test | |
| parent | 36fe45e3a4a7ce9b61ab7bf2df07f0132a9170c1 (diff) | |
| download | pardes-250db41743f77ce3d8421f729bdea0065aa6bc79.tar.gz pardes-250db41743f77ce3d8421f729bdea0065aa6bc79.zip | |
A name under a directory that may not be searched or written is refused, permission denied, and a Save there says so, not no such directory
`pardes noperm/a/b/c` and `pardes /proc/1/root/x` took the missing
directory for one Save would make, opened a pane and exited 0; its Save
then said "no such directory". fs.deniedAbove finds the nearest
directory there and asks whether it may be searched and written:
forwarding refuses such a name, exit 1, "permission denied", and a
failed Save says "permission denied", which the writer's 9P error
carries as EPERM (9ns: EACCES).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test')
| -rw-r--r-- | test/fs.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1405,6 +1405,17 @@ def test(binary, quic=False): dashed, = serials() - before assert client.read(f'/pane/{dashed}/name').rstrip(b'\n') == str(dash).encode() client.remove(f'/pane/{dashed}') + # A name under a directory that may not be searched is refused, + # permission denied, exit 1, no pane: its Save could never be. + (root / 'noperm').mkdir() + (root / 'noperm').chmod(0) + before = serials() + try: + denied = subprocess.run([binary, 'noperm/a/b/c'], cwd=root, env=env, capture_output=True, timeout=10) + finally: + (root / 'noperm').chmod(0o755) + assert denied.returncode == 1 and b'permission denied' in denied.stderr, denied + assert serials() == before # --wait waits on the pane its look answered, on the look's own # open: a name /index shows escaped (a backslash is `\\` there) # is still the pane waited on, not one already gone. |
