fix: quarantine corrupt SAC spool files, flush newest first (2.1.6-SAC)

Reject null-padded spool payloads to rejected/, read UTF-16 spool, process recent events first, and raise flush batch to 20 so daily reports are not blocked by legacy junk.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-25 09:09:54 +10:00
parent ccd50a085d
commit 8a937b8f17
3 changed files with 106 additions and 11 deletions
+2 -2
View File
@@ -90,7 +90,7 @@ $script:SkipLogDetailLimit = 15
# строки ниже, если правки «мелкие» и вы не хотите менять отображаемую версию в логах).
# Рекомендация: при значимых релизах меняйте и $ScriptVersion, и version.txt одинаково; при только
# исправлениях на шаре — достаточно поднять patch в version.txt (например 1.3.0.1).
$ScriptVersion = "2.1.5-SAC"
$ScriptVersion = "2.1.6-SAC"
# Логи (все под InstallRoot)
$LogFile = Join-Path $script:InstallRoot "Logs\login_monitor.log"
@@ -5016,7 +5016,7 @@ function Start-LoginMonitor {
$nextReportCheck = Check-AndSendDailyReport
}
if ($script:SacClientLoaded) {
Invoke-SacFlushSpool -MaxFiles 5 | Out-Null
Invoke-SacFlushSpool -MaxFiles 20 | Out-Null
if ((Get-SacNormalizedMode) -ne 'off' -and $now -ge $script:NextSacCommandPollTime) {
Invoke-SacProcessPendingCommands | Out-Null
$script:NextSacCommandPollTime = $now.AddSeconds($SacCommandPollIntervalSec)