Re-applies two hardening changes from the deleted pkg/tools/filesystem.go to upstream's pkg/tools/fs/filesystem.go (sandboxFs.WriteFile): 1. Reject writes larger than MaxWriteFileSize (20 MB) before opening any file. Prevents runaway writes from a misbehaving caller filling disk. 2. Replace time.Now().UnixNano() temp suffixes with crypto/rand-generated hex. Eliminates predictable temp paths under concurrent or hostile filesystem scenarios; the prior nanosecond stamp could collide on high-resolution clocks across goroutines. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| edit.go | ||
| edit_test.go | ||
| filesystem.go | ||
| filesystem_test.go | ||
| load_image.go | ||
| load_image_test.go | ||
| send_file.go | ||
| send_file_test.go | ||
| shared.go | ||