summaryrefslogtreecommitdiff
path: root/src/ninep/cols.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 03:10:29 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commitcf49c329cb401a5c530ef2533066702fe1545360 (patch)
treecde7ce577a16ba09ddc9453886433144091d403d /src/ninep/cols.zig
parentcf2415cc6527cb92898694aae88fd84d54aac28c (diff)
downloadpardes-cf49c329cb401a5c530ef2533066702fe1545360.tar.gz
pardes-cf49c329cb401a5c530ef2533066702fe1545360.zip
An exec line over 1024 bytes fails the write, naming the limit
A command line longer than the 1024 bytes a command pane takes was said on the message row after the write had already succeeded. An exec write (the root's, a pane's, tagexec, a column's) now refuses it before anything runs, EINVAL with "a command line is at most 1024 bytes" and an err record; a builtin's line, a long Msg or an Edit block, is not limited. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/cols.zig')
-rw-r--r--src/ninep/cols.zig1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ninep/cols.zig b/src/ninep/cols.zig
index 8a3474b3..ad7d30f8 100644
--- a/src/ninep/cols.zig
+++ b/src/ninep/cols.zig
@@ -158,6 +158,7 @@ pub fn writeExec(p: *Pardes, req: Req, serial: ?u32) Reply {
const line = std.mem.trim(u8, raw, " \t\r");
if (line.len == 0) continue;
for (line) |c| if (c < ' ' and c != '\t') return Reply.fail(req.tag, E.INVAL);
+ if (pardes.ctlfs.ctl.tooLong(req, line)) |refusal| return refusal;
const col = if (serial) |s| layout.columnBySerial(p, s) orelse return Reply.fail(req.tag, E.NOENT) else null;
if (p.panes[p.active] == null) return Reply.fail(req.tag, E.NOENT);
p.exec_column = col;