diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-30 23:29:17 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:18 -0300 |
| commit | afaa2428b346f6dd1d165abe1396dce9150fa05c (patch) | |
| tree | 8c7f14cd5f720e61f0eb0104d862fe4f0cc17d4e /test/fs.py | |
| parent | afe51fc6c3675a6aa8ab2f5caf64796b65597c2c (diff) | |
| download | pardes-afaa2428b346f6dd1d165abe1396dce9150fa05c.tar.gz pardes-afaa2428b346f6dd1d165abe1396dce9150fa05c.zip | |
Forwarding pardes FILE for a new name in a directory it may not read or write is refused with words, not a pane that only fails at Save
A new name forwarded into a directory that is there but locked opened
an empty pane named for it, and the failure came only at its Save,
long after the launch. The directory is checked first: one that cannot
be read, written and entered is refused, exit 1, no pane made.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'test/fs.py')
| -rw-r--r-- | test/fs.py | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1403,6 +1403,19 @@ def test(binary, quic=False): # A pane address the session has not is refused in words, exit # 1, no pane made for a file of that name; one it has is looked # at. A name with a newline is said in words, not an error name. + # A new name in a directory there but not writable: refused now, + # not a pane that only fails at Save. + shut = root / 'shut-dir' + shut.mkdir() + shut.chmod(0o500) + try: + refused = subprocess.run([binary, 'shut-dir/new.txt'], cwd=root, env=env, + stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=10) + assert refused.returncode == 1, refused + assert b'may not be read or written' in refused.stderr, refused.stderr + assert serials() == before, (serials(), before) + finally: + shut.chmod(0o755) for word, said in (('@p999:1', b'pardes: @p999:1: this session has no such pane'), ('two\nlines.txt', b'a file name is one line')): refused = subprocess.run([binary, word], cwd=root, env=env, |
