summaryrefslogtreecommitdiff
path: root/src/daemon.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-08 20:50:30 -0300
committerGabriel Schneider <[email protected]>2026-11-08 21:48:19 -0300
commite9e074c1e70f7a6c941deca31116882c434fd3b7 (patch)
treecb299c28e89e255e8a2c448c18ed092c59ce71d4 /src/daemon.zig
parentd31cc9eb97da97e3cb5268565ced3bf8c25f8540 (diff)
downloadpardes-e9e074c1e70f7a6c941deca31116882c434fd3b7.tar.gz
pardes-e9e074c1e70f7a6c941deca31116882c434fd3b7.zip
fix: a window handover under a runtime directory too long for a window's 9P socket made the window and waited 15 s on a registry entry that could never answer (past ~490 bytes its path was empty): it says so first, no new window: XDG_RUNTIME_DIR is N bytes, too long for its 9P socket; daemon.find's reason for a name past its room is cut, never empty (Zig 0.17's bufPrint writes what fits), and a test pins that
Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/daemon.zig')
-rw-r--r--src/daemon.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/daemon.zig b/src/daemon.zig
index f02c339e..84c77f90 100644
--- a/src/daemon.zig
+++ b/src/daemon.zig
@@ -1232,3 +1232,13 @@ test "a message carries its words and its fds, and the peer's end is null" {
_ = libc.close(pair[1]);
try std.testing.expect(recv(pair[0], &buf) == null);
}
+
+test "an attach by a name longer than any session's is refused in words, never an empty reason" {
+ var d: Daemon = .{};
+ var why: [512]u8 = undefined;
+ const long: []const u8 = &@as([600]u8, @splat('n'));
+ try std.testing.expect(d.find(.tty, long, &why) == null);
+ const said = std.mem.sliceTo(&why, 0);
+ try std.testing.expect(std.mem.startsWith(u8, said, "no "));
+ try std.testing.expect(said.len > "no ".len);
+}