diff options
| author | historia <[not public]> | 2026-09-18 15:16:44 -0400 |
|---|---|---|
| committer | historia <[not public]> | 2026-09-18 15:16:44 -0400 |
| commit | 7eab582d8a8ee2af1a6baae7baf0696c7005de2e (patch) | |
| tree | 902bbc8c6e39c9f62f779ca23267714ec420b9f5 /internal/admin/undo.go | |
| parent | 153acb7f644d755c45533b7c5311e3ffa47e8973 (diff) | |
| download | thehouseoficarus-7eab582d8a8ee2af1a6baae7baf0696c7005de2e.tar.gz | |
fix: harden triggers, economy, casino, world data, and admin/net paths
Diffstat (limited to 'internal/admin/undo.go')
| -rw-r--r-- | internal/admin/undo.go | 8 |
1 files changed, 5 insertions, 3 deletions
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) } |
