From 9fddd372ed88886bf98e5c9d5ca88cee9a272357 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 1 Oct 2026 08:42:44 -0300 Subject: 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 --- src/ninep/ctl.zig | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ninep/ctl.zig') 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"); +} -- cgit v1.3