From 98e94b86a7c38e2bf4d66e57144fc9329906bb3b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 03:37:13 -0300 Subject: 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 --- src/ninep/ctl.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ninep/ctl.zig') 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()); -- cgit v1.3