diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-08 21:13:29 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-08 21:48:19 -0300 |
| commit | 24b8178d7ba0db8b0ec38769f859e9f47afbfa62 (patch) | |
| tree | 590b6aeef32159a1e01fd6efe441f07355575411 /src/main.zig | |
| parent | 97568ff864876098579f5510624ae92995404d75 (diff) | |
| download | pardes-24b8178d7ba0db8b0ec38769f859e9f47afbfa62.tar.gz pardes-24b8178d7ba0db8b0ec38769f859e9f47afbfa62.zip | |
fix: a session whose runtime directory was not the user's alone ran with no 9P socket and no word, which read as a detached session parked before its listener (a bash recipe's mkdir -m 700 -p dir/sub leaves dir at the umask's 755; smoke.py chmods it): the socket check (9p_io.noSocket, the long path's too) says no socket: <dir> must be a directory of yours alone (mode 755, owner 1000): chmod 700 it, to the log, pane 0's message and a --detach start's stderr, and --9p's help says the directory must be mode 700; a unit test opens the directory to others
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig index b6f57873..c36c4eb7 100644 --- a/src/main.zig +++ b/src/main.zig @@ -85,7 +85,8 @@ const help_text = \\ --9p=<name> name the default 9P socket. Without this flag, \\ the name is the detached session name or pid. \\ The socket is under $XDG_RUNTIME_DIR, falling - \\ back to ~/.local/state/pardes. + \\ back to ~/.local/state/pardes: a directory + \\ of the user's alone (mode 700), or none. \\ --9p-tcp=<dial> also serve 9P at tcp!<numeric-ip>!<port>. \\ --mount=<name>=<dial> mount a 9P session or Unix/TCP endpoint under /n/<name>. \\ Repeat for more mounts; os and self are reserved. @@ -746,11 +747,11 @@ fn nativeMain(std_init: std.process.Init) !void { // Said where it was started (stderr, as the log says it): no pane // anyone sees would show it. The session runs on, with no 9P. var pid_buf: [16]u8 = undefined; - var words_buf: [160]u8 = undefined; + var words_buf: [256]u8 = undefined; const entry = if (opts.ninep_name.len != 0) opts.ninep_name else std.fmt.bufPrint(&pid_buf, "{d}", .{std.c.getpid()}) catch unreachable; // a pid fits 16 - if (ninep_io.tooLong(entry, &words_buf)) |words| { - var line_buf: [200]u8 = undefined; - std.Io.File.stderr().writeStreamingAll(init.io, std.fmt.bufPrint(&line_buf, "pardes: {s}\n", .{words}) catch unreachable) catch {}; // 160 fits 200 + if (ninep_io.noSocket(entry, &words_buf)) |words| { + var line_buf: [300]u8 = undefined; + std.Io.File.stderr().writeStreamingAll(init.io, std.fmt.bufPrint(&line_buf, "pardes: {s}\n", .{words}) catch unreachable) catch {}; // 256 fits 300 } // Nobody's size yet: one roomy enough for a script's panes; `size` // sets another, and an attached terminal or window its own. |
