summaryrefslogtreecommitdiff
path: root/src/9p_io.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 13:36:33 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:16 -0300
commitfea3f2c5abf14aada5d9187b82985e51eb5b7a98 (patch)
tree6dd3c54c8aaa1ad5941a74200b18da12e512b7fb /src/9p_io.zig
parentbe5f559939fc11cbfba95b4a7d518816bec8677a (diff)
downloadpardes-fea3f2c5abf14aada5d9187b82985e51eb5b7a98.tar.gz
pardes-fea3f2c5abf14aada5d9187b82985e51eb5b7a98.zip
A path with a part over 255 bytes is refused, never a panic
std's statFile takes the kernel's ENAMETOOLONG for a bug (errnoBug), so a name, look, DumpDir or Save path with a part over 255 bytes panicked the editor (exec.kindOf via writeName, recentKeeps, dumpFailed). Every non-test statFile now goes through fs.statPath, which refuses such a name as NameTooLong first; fs.py drives long, looping, not-a-directory and not-ours paths through name, look, DumpDir, Dump and Save. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/9p_io.zig')
-rw-r--r--src/9p_io.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/9p_io.zig b/src/9p_io.zig
index 96f91bc1..560c4ed6 100644
--- a/src/9p_io.zig
+++ b/src/9p_io.zig
@@ -865,7 +865,7 @@ pub fn listen(io: std.Io, gpa: std.mem.Allocator, core: *pardes.Pardes, named: [
return null;
};
_ = l.runner.listen(.{ .unix = p }, max_conns) catch |err| retry: {
- const existing = std.Io.Dir.cwd().statFile(io, p, .{ .follow_symlinks = false }) catch null;
+ const existing = @import("fs.zig").statPath(io, p, .{ .follow_symlinks = false }) catch null;
if (err != error.AddressInUse or existing == null or existing.?.kind != .unix_domain_socket or alive(p)) {
log.warn("something is already listening on {s}", .{p});
l.deinit(gpa);