szn

Bug 62 — resolveLogPath calls mkdir with 0o777 and silently ignores failure

62. resolveLogPath calls mkdir with 0o777 and silently ignores failure

File: src/main.zig:30 Severity: LOW Status: ✅ FIXED — Added check for mkdir return code and fallback to /tmp/szn.log on failure (unless EEXIST).

_ = c.mkdir(dir_z.ptr, 0o777);
return try std.fmt.bufPrintZ(buf, "{s}/szn/szn.log", .{xdg});

If the intermediate directory ($XDG_STATE_HOME) doesn’t exist or isn’t writable, mkdir silently fails. The subsequent open() for the log file also fails silently (the log function just returns without logging). The first std.log.info or std.log.warn calls during server startup are lost, making startup issues hard to debug.