summaryrefslogtreecommitdiff
path: root/src/ninep/ctl.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-10-01 08:42:44 -0300
committerGabriel Schneider <[email protected]>2026-10-01 08:53:11 -0300
commit9fddd372ed88886bf98e5c9d5ca88cee9a272357 (patch)
treef9a70b48f101d644966f272c0797e67b6d3f9b02 /src/ninep/ctl.zig
parent84b3bb51d7009902659e05f94c53c82d109ba8f6 (diff)
downloadpardes-9fddd372ed88886bf98e5c9d5ca88cee9a272357.tar.gz
pardes-9fddd372ed88886bf98e5c9d5ca88cee9a272357.zip
A Mount dial with a network pardes does not dial (`nowhere!x`) is a bad dial address, EINVAL, not a session name that does not answer
A dial with a `!` and no `/` that was neither tcp!, quic! nor unix! was taken for a session's name, failing as `dial failed: no answer`, EIO. It is now refused as the malformed address it is, before any dial. A path with a `!` in it still dials. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/ctl.zig')
-rw-r--r--src/ninep/ctl.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index d4d09e0b..3ec1f4d6 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -4371,3 +4371,11 @@ test "DumpDir refuses a relative directory and one that may not be written, up f
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"));
}
+
+test "a Mount dial with a network it does not know is a bad dial address, EINVAL" {
+ const p = try withFile(testing.allocator, "x\n");
+ defer p.deinit();
+ const r = wr(p, @intFromEnum(tree.TopFile.ctl), "Mount peer nowhere!x\n");
+ try testing.expectEqual(E.INVAL, r.errno());
+ try testing.expectStringStartsWith(r.reply.ename, "Mount: bad dial address: nowhere!x");
+}