summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 05:01:31 -0300
committerGabriel Schneider <[email protected]>2026-10-01 05:18:09 -0300
commit250db41743f77ce3d8421f729bdea0065aa6bc79 (patch)
tree906bbefca6d448ba04c81c93cf552e23b5e6c3a4 /src/ninep/ctl.zig
parent36fe45e3a4a7ce9b61ab7bf2df07f0132a9170c1 (diff)
downloadpardes-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 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index c88eb328..d6d7a6ee 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -4056,3 +4056,12 @@ test "a command pane an exec open was answered is leased to it while it stays op
try testing.expectEqual(Status.ok, wr(p, exec, "echo c\n").reply.status);
try testing.expectEqual(a_pane, p.paneBySerial(p.fs.results[0]).?);
}
+
+test "a Save whose directory is missing because one above refuses says permission denied, not no such directory" {
+ const p = try withFile(testing.allocator, "x\n");
+ defer p.deinit();
+ p.saveFailed(0, "/proc/1/root/x/f.txt", error.FileNotFound);
+ try testing.expect(th.logHas(p, "Save /proc/1/root/x/f.txt: permission denied"));
+ p.saveFailed(0, "/tmp/pardes-surely-missing-dir/f.txt", error.FileNotFound);
+ try testing.expect(th.logHas(p, "no such directory"));
+}