From 7eab582d8a8ee2af1a6baae7baf0696c7005de2e Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Fri, 18 Sep 2026 15:16:44 -0400 Subject: fix: harden triggers, economy, casino, world data, and admin/net paths --- internal/admin/undo.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'internal/admin/undo.go') diff --git a/internal/admin/undo.go b/internal/admin/undo.go index 7bfbe09..24ce9c1 100644 --- a/internal/admin/undo.go +++ b/internal/admin/undo.go @@ -9,6 +9,8 @@ import ( "strings" "sync" "time" + + "thehouseoficarus/internal/persistence" ) type ExtraFile struct { @@ -537,12 +539,12 @@ func (us *UndoStack) save() { log.Printf("undo: failed to marshal history: %v", err) return } - if err := os.WriteFile(us.filePath, b, 0600); err != nil { + if err := persistence.WriteFile(us.filePath, b, 0600); err != nil { log.Printf("undo: failed to write history file: %v", err) return } - // os.WriteFile does not change an existing file's mode: tighten a history - // file that a previous version created world-readable. + // persistence.WriteFile preserves an existing file's mode: tighten a + // history file that a previous version created world-readable. if err := os.Chmod(us.filePath, 0600); err != nil { log.Printf("undo: failed to secure history file: %v", err) } -- cgit v1.2.3