summaryrefslogtreecommitdiff
path: root/src/ninep/pane.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 17:54:56 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit08c4a01f799ae250577d99a61f23eef7d66e439a (patch)
tree1970f7b6628ffa6770e6d42dabac4d8d8df572b0 /src/ninep/pane.zig
parent7de6d8304f563023c4a5fa9f8223f9ed626c5f91 (diff)
downloadpardes-08c4a01f799ae250577d99a61f23eef7d66e439a.tar.gz
pardes-08c4a01f799ae250577d99a61f23eef7d66e439a.zip
A malformed flag write reads as EINVAL through a mount again
The refusal `takes 1 or 0` matched none of 9ns's words, so a mount turned it into EIO. It now starts `bad flag:`, which 9ns maps to EINVAL, as it did the bare errno before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/pane.zig')
-rw-r--r--src/ninep/pane.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ninep/pane.zig b/src/ninep/pane.zig
index d2b2a791..f87e43a6 100644
--- a/src/ninep/pane.zig
+++ b/src/ninep/pane.zig
@@ -507,7 +507,7 @@ fn writeRange(req: Req, pane: *Pane, file: PaneFile) Reply {
fn writeFlag(p: *Pardes, req: Req, pane: *Pane, file: PaneFile) Reply {
const word = std.mem.trim(u8, req.data, " \t\r\n");
- if (!std.mem.eql(u8, word, "1") and !std.mem.eql(u8, word, "0")) return tree.failText(req.tag, E.INVAL, "takes 1 or 0");
+ if (!std.mem.eql(u8, word, "1") and !std.mem.eql(u8, word, "0")) return tree.failText(req.tag, E.INVAL, "bad flag: takes 1 or 0");
const on = word[0] == '1';
const pf = &pane.fs;
switch (file) {
@@ -875,7 +875,7 @@ test "the flag files read and write the state acme kept behind ctl verbs" {
try testing.expectEqual(@as(u64, 2), call(p, .{ .tag = 1, .op = .getattr, .node = node }).reply.attr.size);
for ([_][]const u8{ "", "yes", "2", "0 1", "true" }) |bad| {
try testing.expectEqual(E.INVAL, wr(p, node, bad).errno());
- try testing.expectEqualStrings("takes 1 or 0", wr(p, node, bad).reply.ename);
+ try testing.expectEqualStrings("bad flag: takes 1 or 0", wr(p, node, bad).reply.ename);
}
}