summaryrefslogtreecommitdiff
path: root/src/ninep
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 03:37:13 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit98e94b86a7c38e2bf4d66e57144fc9329906bb3b (patch)
tree61a7c596cd54dbc4d7a0b17243f592b2fb4bab80 /src/ninep
parentd067c77813f9ce9fcc64b33e6b0284510ac02185 (diff)
downloadpardes-98e94b86a7c38e2bf4d66e57144fc9329906bb3b.tar.gz
pardes-98e94b86a7c38e2bf4d66e57144fc9329906bb3b.zip
Tty and Shell refuse a directory: not a shell
A directory passes access(X_OK), so Tty /etc made a pane whose shell exited 127 and Shell /etc was taken. The shell lookup now refuses a directory, and both say "not a shell: /etc is a directory" (Tty and Shell share one refusal, host_io.Shell.refusal). shellset's golden takes the shared wording (re-recorded by name). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep')
-rw-r--r--src/ninep/ctl.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ninep/ctl.zig b/src/ninep/ctl.zig
index 26a18a12..dd2d9ed0 100644
--- a/src/ninep/ctl.zig
+++ b/src/ninep/ctl.zig
@@ -1428,8 +1428,10 @@ test "Shell refuses a path that is no executable, and bare it goes back to the d
const root_ctl = @intFromEnum(tree.TopFile.ctl);
const refused = wr(p, root_ctl, "Shell /nonexistent/zzsh\n");
try testing.expectEqual(Status.err, refused.reply.status);
- try testing.expect(std.mem.indexOf(u8, refused.reply.ename, "Shell: /nonexistent/zzsh: no executable by that name") != null);
- try testing.expect(th.logHas(p, "/nonexistent/zzsh: no executable"));
+ try testing.expect(std.mem.indexOf(u8, refused.reply.ename, "Shell: no shell \"/nonexistent/zzsh\"") != null);
+ try testing.expect(th.logHas(p, "no shell \"/nonexistent/zzsh\""));
+ try testing.expectEqual(E.IO, wr(p, root_ctl, "Shell /etc\n").errno());
+ try testing.expect(th.logHas(p, "Shell: not a shell: /etc is a directory"));
try testing.expectEqualStrings("", p.settings.shell.requested.get());
try testing.expectEqual(Status.ok, wr(p, root_ctl, "Shell /bin/sh\n").reply.status);
try testing.expectEqualStrings("/bin/sh", p.settings.shell.requested.get());