summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/ctl.zig15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 9cb96667..3176ebc8 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -4676,8 +4676,8 @@ test "pager answers its +Pager on the open that asked, whatever another client e
try testing.expectEqualStrings("/tmp/+Pager", second_pane.file.?.path);
try testing.expect(p.paneBySerial(paged) != null);
_ = call(p, .{ .tag = 14, .op = .release, .node = pager, .handle = resolved, .opened = true });
- // One that may not be written is refused, permission denied.
- try testing.expectEqual(E.PERM, wr(p, pager, "/proc/1\n").errno());
+ // One that may not be written is refused, permission denied (Linux's /proc/1).
+ if (comptime @import("builtin").os.tag == .linux) try testing.expectEqual(E.PERM, wr(p, pager, "/proc/1\n").errno());
// One directory a write, absolute, and there.
try testing.expectEqual(E.INVAL, wr(p, pager, "/a\n/b\n").errno());
// One directory an open: one refused is not followed by another, as a
@@ -4786,8 +4786,11 @@ test "a command pane an exec open was answered is leased to it while it stays op
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"));
+ // The refusing directory is Linux's /proc/1/root.
+ if (comptime @import("builtin").os.tag == .linux) {
+ 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"));
}
@@ -5036,8 +5039,10 @@ test "DumpDir refuses a relative directory and one that may not be written, up f
defer p.deinit();
const root_ctl = @backingInt(tree.TopFile.ctl);
try testing.expectEqual(E.INVAL, wr(p, root_ctl, "DumpDir dumps\n").errno());
- try testing.expectEqual(E.INVAL, wr(p, root_ctl, "DumpDir /proc/1/root/dumps\n").errno());
try testing.expectEqual(Status.ok, wr(p, root_ctl, "DumpDir /tmp/pardes-dumps-test\n").reply.status);
+ // The refusing directory is Linux's /proc/1/root.
+ if (comptime @import("builtin").os.tag != .linux) return;
+ try testing.expectEqual(E.INVAL, wr(p, root_ctl, "DumpDir /proc/1/root/dumps\n").errno());
p.fs.late_failure_len = 0;
p.dumpFailed("/proc/1/root/x/pardes.dump.zon", error.FileNotFound);
try testing.expect(std.mem.endsWith(u8, p.fs.late_failure[0..p.fs.late_failure_len], ": permission denied"));