wanshenmean
2026-03-13 efbfb630f60f6663deba83ec12c1fbf2f9bab183
分支
用户 wanshenmean <cathay_xy@163.com>
星期五, 三月 13, 2026 13:44 +0800
提交者 wanshenmean <cathay_xy@163.com>
星期五, 三月 13, 2026 13:44 +0800
提交efbfb630f60f6663deba83ec12c1fbf2f9bab183
目录 b9f723160564693deaf4105b9419a8eddf2d9599 目录 | zip | gz
上一版本 0b3d9467bfd081f607c7b17642e6c017aa32678d 查看 | 对比
fix: improve FilePersistenceService code quality and security

CRITICAL fixes:
- Add SemaphoreSlim for thread-safe file operations
- Add Console.WriteLine error logging for diagnostics
- Implement atomic file writes using temp file + File.Replace

MAJOR fixes:
- Add instanceId validation to prevent path traversal attacks
- Make JsonSerializerOptions static readonly for thread safety
- Add error handling in constructor for Directory.CreateDirectory

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
已修改1个文件
344 ■■■■ 文件已修改
Code/WCS/WIDESEAWCS_S7Simulator/WIDESEAWCS_S7Simulator.Core/Persistence/FilePersistenceService.cs 344 ●●●● 对比 | 查看 | 原始文档 | blame | 历史