@@ -47,11 +47,18 @@ AuthorizedKeysFile $authFile
4747" " | Out-File - FilePath $authFile - Encoding ASCII
4848if (Test-Path $logFile ) { Remove-Item $logFile - Force }
4949
50+ # Capture the daemon's own stdout/stderr (where the [SSHD-DBG] diagnostics go)
51+ # so we can inspect them even if the -E log file mechanism is not writing.
52+ $stdoutFile = Join-Path $scriptDir " grace_stdout.txt"
53+ $stderrFile = Join-Path $scriptDir " grace_stderr.txt"
54+
5055# Run wolfsshd in the foreground (-D) with debug logging to a file (-E). On
5156# Windows, -D selects the non-service foreground path, which lets us read the
5257# log just like the Unix test does.
5358$sshd = Start-Process - FilePath $SshdExe `
5459 - ArgumentList " -D" , " -d" , " -E" , " `" $logFile `" " , " -f" , " `" $confFile `" " , " -p" , " $Port " `
60+ - RedirectStandardOutput $stdoutFile `
61+ - RedirectStandardError $stderrFile `
5562 - NoNewWindow - PassThru
5663
5764try {
@@ -104,6 +111,18 @@ try {
104111 }
105112 Write-Host " === end of wolfsshd log ==="
106113
114+ # Dump the daemon's captured stdout/stderr (carries the [SSHD-DBG] lines).
115+ foreach ($f in @ ($stdoutFile , $stderrFile )) {
116+ Write-Host " === daemon $ ( Split-Path - Leaf $f ) ==="
117+ if ((Test-Path $f ) -and ((Get-Item $f ).Length -gt 0 )) {
118+ Get-Content $f
119+ }
120+ else {
121+ Write-Host " (empty)"
122+ }
123+ Write-Host " === end ==="
124+ }
125+
107126 if ((Test-Path $logFile ) -and
108127 (Select-String - Path $logFile - Pattern " Failed login within grace period" - Quiet)) {
109128 Write-Host " PASS: unauthenticated connection dropped at login grace deadline"
0 commit comments