summaryrefslogtreecommitdiff
path: root/src/ninep/events.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 01:44:13 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:15 -0300
commit8322d6507a854fc41bba42b9e8b8672d33cfe18b (patch)
treec829f96c9447cf968cc5e015e75c4978ec233dae /src/ninep/events.zig
parent4a662c32888ed055b3e42faa5afc31dcaeb09fc4 (diff)
downloadpardes-8322d6507a854fc41bba42b9e8b8672d33cfe18b.tar.gz
pardes-8322d6507a854fc41bba42b9e8b8672d33cfe18b.zip
An error on a column's ctl, exec or rmdir names that file in the log
noteError named every column node col/<serial>/tag, so a refused ctl write or rmdir pointed at the tag. It now names col/<serial>/ctl, /exec, /tag or the directory itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/ninep/events.zig')
-rw-r--r--src/ninep/events.zig7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ninep/events.zig b/src/ninep/events.zig
index ccc61352..7402a763 100644
--- a/src/ninep/events.zig
+++ b/src/ninep/events.zig
@@ -165,7 +165,7 @@ pub fn notePath(p: *Pardes, what: []const u8, path: []const u8) void {
pub fn noteError(p: *Pardes, req: Req, reply: Reply) void {
const why = if (reply.ename.len > 0) reply.ename else cloud9.fs.errString(reply.errno);
- var name: [16]u8 = undefined;
+ var name: [32]u8 = undefined;
var serial: []const u8 = "-";
var file: []const u8 = "os";
if (req.node & tree.sources.archive_node != 0) file = "src";
@@ -174,7 +174,10 @@ pub fn noteError(p: *Pardes, req: Req, reply: Reply) void {
.top => |f| file = f.fileName(),
.col => |c| {
serial = "-";
- file = std.fmt.bufPrint(&name, "col/{d}/tag", .{c.serial}) catch "col";
+ file = (if (c.file == .dir)
+ std.fmt.bufPrint(&name, "col/{d}", .{c.serial})
+ else
+ std.fmt.bufPrint(&name, "col/{d}/{s}", .{ c.serial, @tagName(c.file) })) catch "col";
},
.pane => |pt| {
serial = std.fmt.bufPrint(&name, "{d}", .{pt.serial}) catch "-";