Skip to content

Commit c168016

Browse files
committed
Source snapshot from Powershell/openssh-portable:latestw_all
1 parent 993c156 commit c168016

39 files changed

+810
-374
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 0.0.17.0.{build}
1+
version: 0.0.19.0.{build}
22
image: Visual Studio 2015
33

44
branches:

contrib/win32/openssh/OpenSSHTestHelper.psm1

Lines changed: 80 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ $Script:UnitTestResultsFile = Join-Path $TestDataPath $UnitTestResultsFileName
2020
$Script:TestSetupLogFile = Join-Path $TestDataPath $TestSetupLogFileName
2121
$Script:E2ETestDirectory = Join-Path $repositoryRoot.FullName -ChildPath "regress\pesterTests"
2222
$Script:WindowsInBox = $false
23+
$Script:EnableAppVerifier = $true
24+
$Script:PostmortemDebugging = $false
2325

2426
<#
2527
.Synopsis
@@ -32,8 +34,10 @@ function Set-OpenSSHTestEnvironment
3234
param
3335
(
3436
[string] $OpenSSHBinPath,
35-
[string] $TestDataPath = "$env:SystemDrive\OpenSSHTests",
36-
[Boolean] $DebugMode = $false
37+
[string] $TestDataPath = "$env:SystemDrive\OpenSSHTests",
38+
[Boolean] $DebugMode = $false,
39+
[Switch] $NoAppVerifier,
40+
[Switch] $PostmortemDebugging
3741
)
3842

3943
if($PSBoundParameters.ContainsKey("Verbose"))
@@ -51,7 +55,11 @@ function Set-OpenSSHTestEnvironment
5155
$Script:UnitTestResultsFile = Join-Path $TestDataPath "UnitTestResults.txt"
5256
$Script:TestSetupLogFile = Join-Path $TestDataPath "TestSetupLog.txt"
5357
$Script:UnitTestDirectory = Get-UnitTestDirectory
54-
58+
$Script:EnableAppVerifier = -not ($NoAppVerifier.IsPresent)
59+
if($Script:EnableAppVerifier)
60+
{
61+
$Script:PostmortemDebugging = $PostmortemDebugging.IsPresent
62+
}
5563

5664
$Global:OpenSSHTestInfo = @{
5765
"Target"= "localhost"; # test listener name
@@ -67,6 +75,8 @@ function Set-OpenSSHTestEnvironment
6775
"E2ETestDirectory" = $Script:E2ETestDirectory # the directory of E2E tests
6876
"UnitTestDirectory" = $Script:UnitTestDirectory # the directory of unit tests
6977
"DebugMode" = $DebugMode # run openssh E2E in debug mode
78+
"EnableAppVerifier" = $Script:EnableAppVerifier
79+
"PostmortemDebugging" = $Script:PostmortemDebugging
7080
}
7181

7282
#if user does not set path, pick it up
@@ -237,6 +247,24 @@ WARNING: Following changes will be made to OpenSSH configuration
237247
cmd /c "ssh-add -D 2>&1 >> $Script:TestSetupLogFile"
238248
Repair-UserKeyPermission -FilePath $testPriKeypath -confirm:$false
239249
cmd /c "ssh-add $testPriKeypath 2>&1 >> $Script:TestSetupLogFile"
250+
251+
#Enable AppVerifier
252+
if($EnableAppVerifier)
253+
{
254+
# clear all applications in application verifier first
255+
& $env:windir\System32\appverif.exe -disable * -for * | out-null
256+
Get-ChildItem "$($script:OpenSSHBinPath)\*.exe" | % {
257+
& $env:windir\System32\appverif.exe -verify $_.Name | out-null
258+
}
259+
260+
if($Script:PostmortemDebugging -and (Test-path $Script:WindbgPath))
261+
{
262+
# enable Postmortem debugger
263+
New-ItemProperty "HKLM:Software\Microsoft\Windows NT\CurrentVersion\AeDebug" -Name Debugger -Type String -Value "`"$Script:WindbgPath`" -p %ld -e %ld -g" -Force -ErrorAction SilentlyContinue | Out-Null
264+
New-ItemProperty "HKLM:Software\Microsoft\Windows NT\CurrentVersion\AeDebug" -Name Auto -Type String -Value "1" -Force -ErrorAction SilentlyContinue | Out-Null
265+
}
266+
}
267+
240268
Backup-OpenSSHTestInfo
241269
}
242270
#TODO - this is Windows specific. Need to be in PAL
@@ -294,6 +322,31 @@ function Install-OpenSSHTestDependencies
294322
Write-Log -Message "Installing Pester..."
295323
choco install Pester -y --force --limitoutput 2>&1 >> $Script:TestSetupLogFile
296324
}
325+
326+
if($Script:PostmortemDebugging -or (($OpenSSHTestInfo -ne $null) -and ($OpenSSHTestInfo["PostmortemDebugging"])))
327+
{
328+
$folderName = "x86"
329+
$pathroot = $env:ProgramFiles
330+
if($env:PROCESSOR_ARCHITECTURE -ieq "AMD64")
331+
{
332+
$folderName = "x64"
333+
$pathroot = ${env:ProgramFiles(x86)}
334+
}
335+
$Script:WindbgPath = "$pathroot\Windows Kits\8.1\Debuggers\$folderName\windbg.exe"
336+
if(-not (Test-Path $Script:WindbgPath))
337+
{
338+
$Script:WindbgPath = "$pathroot\Windows Kits\10\Debuggers\$folderName\windbg.exe"
339+
if(-not (Test-Path $Script:WindbgPath))
340+
{
341+
choco install windbg -y --force --limitoutput 2>&1 >> $Script:TestSetupLogFile
342+
}
343+
}
344+
}
345+
346+
if(($Script:EnableAppVerifier -or (($OpenSSHTestInfo -ne $null) -and ($OpenSSHTestInfo["EnableAppVerifier"]))) -and (-not (Test-path $env:windir\System32\appverif.exe)))
347+
{
348+
choco install appverifier -y --force --limitoutput 2>&1 >> $Script:TestSetupLogFile
349+
}
297350
}
298351

299352
function Install-OpenSSHUtilsModule
@@ -313,12 +366,12 @@ function Install-OpenSSHUtilsModule
313366
}
314367

315368
$modulePath = Join-Path -Path $env:ProgramFiles -ChildPath WindowsPowerShell\Modules
316-
if(-not (Test-Path $targetDirectory -PathType Container))
369+
if(-not (Test-Path "$targetDirectory" -PathType Container))
317370
{
318-
New-Item -ItemType Directory -Path $targetDirectory -Force -ErrorAction SilentlyContinue | out-null
371+
New-Item -ItemType Directory -Path "$targetDirectory" -Force -ErrorAction SilentlyContinue | out-null
319372
}
320-
Copy-item $manifestFile -Destination $targetDirectory -Force -ErrorAction SilentlyContinue | out-null
321-
Copy-item $moduleFile -Destination $targetDirectory -Force -ErrorAction SilentlyContinue | out-null
373+
Copy-item "$manifestFile" -Destination "$targetDirectory" -Force -ErrorAction SilentlyContinue | out-null
374+
Copy-item "$moduleFile" -Destination "$targetDirectory" -Force -ErrorAction SilentlyContinue | out-null
322375

323376
if ($PSVersionTable.PSVersion.Major -lt 4)
324377
{
@@ -396,6 +449,18 @@ function Clear-OpenSSHTestEnvironment
396449
Get-ChildItem "$sshBinPath\sshtest*hostkey*.pub"| % {
397450
ssh-add-hostkey.ps1 -Delete_key $_.FullName
398451
}
452+
453+
if($Global:OpenSSHTestInfo["EnableAppVerifier"] -and (Test-path $env:windir\System32\appverif.exe))
454+
{
455+
# clear all applications in application verifier
456+
& $env:windir\System32\appverif.exe -disable * -for * | out-null
457+
}
458+
459+
if($Global:OpenSSHTestInfo["PostmortemDebugging"])
460+
{
461+
Remove-ItemProperty "HKLM:Software\Microsoft\Windows NT\CurrentVersion\AeDebug" -Name Debugger -ErrorAction SilentlyContinue -Force | Out-Null
462+
Remove-ItemProperty "HKLM:Software\Microsoft\Windows NT\CurrentVersion\AeDebug" -Name Auto -ErrorAction SilentlyContinue -Force | Out-Null
463+
}
399464

400465
Remove-Item $sshBinPath\sshtest*hostkey* -Force -ErrorAction SilentlyContinue
401466
#Restore sshd_config
@@ -442,7 +507,7 @@ function Clear-OpenSSHTestEnvironment
442507
{
443508
Write-Log -Message "Uninstalling Module OpenSSHUtils..."
444509
Uninstall-OpenSSHUtilsModule
445-
}
510+
}
446511
}
447512

448513
<#
@@ -506,13 +571,18 @@ function Get-UnitTestDirectory
506571
Run OpenSSH pester tests.
507572
#>
508573
function Invoke-OpenSSHE2ETest
509-
{
574+
{
575+
[CmdletBinding()]
576+
param
577+
(
578+
[ValidateSet('CI', 'Scenario')]
579+
[string]$pri = "CI")
510580
# Discover all CI tests and run them.
511581
Import-Module pester -force -global
512582
Push-Location $Script:E2ETestDirectory
513583
Write-Log -Message "Running OpenSSH E2E tests..."
514584
$testFolders = @(Get-ChildItem *.tests.ps1 -Recurse | ForEach-Object{ Split-Path $_.FullName} | Sort-Object -Unique)
515-
Invoke-Pester $testFolders -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag 'CI'
585+
Invoke-Pester $testFolders -OutputFormat NUnitXml -OutputFile $Script:E2ETestResultsFile -Tag $pri -PassThru
516586
Pop-Location
517587
}
518588

contrib/win32/openssh/config.h.vs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,9 @@
189189

190190
/* Define to 1 if you have the `arc4random' function. */
191191
/* #undef HAVE_ARC4RANDOM */
192-
#define HAVE_ARC4RANDOM 1
193192

194193
/* Define to 1 if you have the `arc4random_buf' function. */
195194
/* #undef HAVE_ARC4RANDOM_BUF */
196-
#define HAVE_ARC4RANDOM_BUF 1
197195

198196
/* Define to 1 if you have the `arc4random_uniform' function. */
199197
/* #undef HAVE_ARC4RANDOM_UNIFORM */

contrib/win32/openssh/config.vcxproj

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,18 @@
112112
<AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(LibreSSL-x86-Path);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
113113
</Link>
114114
<PreBuildEvent>
115-
<Command>powershell.exe -Executionpolicy Bypass "$(SolutionDir)config.ps1" -Config_h_vs '$(SolutionDir)config.h.vs' -Config_h '$(OpenSSH-Src-Path)config.h' -VCIncludePath '$(VC_IncludePath)' -OutCRTHeader '$(OpenSSH-Src-Path)contrib\win32\win32compat\inc\crtheaders.h'</Command>
115+
<Command>powershell.exe -Executionpolicy Bypass -File "$(SolutionDir)config.ps1" -Config_h_vs "$(SolutionDir)config.h.vs" -Config_h "$(OpenSSH-Src-Path)config.h" -VCIncludePath "$(VC_IncludePath)" -OutCRTHeader "$(OpenSSH-Src-Path)contrib\win32\win32compat\inc\crtheaders.h"</Command>
116116
</PreBuildEvent>
117117
<PreBuildEvent>
118118
<Message>Generate crtheaders.h and config.h</Message>
119119
</PreBuildEvent>
120120
<PostBuildEvent>
121-
<Command>copy /Y $(SolutionDir)install-ssh*ps1 $(OutDir)
122-
copy /Y $(SolutionDir)uninstall-ssh*ps1 $(OutDir)
123-
copy /Y $(SolutionDir)OpenSSHUtils.ps*1 $(OutDir)
124-
copy /Y $(SolutionDir)Fix*FilePermissions.ps1 $(OutDir)
125-
copy /Y $(SolutionDir)ssh-add-hostkey.ps1 $(OutDir)
126-
If NOT exist $(OutDir)\sshd_config (copy $(SolutionDir)sshd_config $(OutDir))</Command>
121+
<Command>copy /Y "$(SolutionDir)install-ssh*ps1" "$(OutDir)"
122+
copy /Y "$(SolutionDir)uninstall-ssh*ps1" "$(OutDir)"
123+
copy /Y "$(SolutionDir)OpenSSHUtils.ps*1" "$(OutDir)"
124+
copy /Y "$(SolutionDir)Fix*FilePermissions.ps1" "$(OutDir)"
125+
copy /Y "$(SolutionDir)ssh-add-hostkey.ps1" "$(OutDir)"
126+
If NOT exist "$(OutDir)\sshd_config" (copy "$(SolutionDir)sshd_config" "$(OutDir)")</Command>
127127
<Message>Copy install-sshd.ps1, uninstall-sshd.ps1, OpenSSHUtils.psm1, OpenSSHUtils.psd1, FixHostFilePermissions.ps1, FixUserFilePermissions.ps1, ssh-add-hostkey.ps1, and sshd_config (if not already present) to build directory</Message>
128128
</PostBuildEvent>
129129
</ItemDefinitionGroup>
@@ -145,18 +145,18 @@ If NOT exist $(OutDir)\sshd_config (copy $(SolutionDir)sshd_config $(OutDir))</C
145145
<AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(LibreSSL-x64-Path);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
146146
</Link>
147147
<PreBuildEvent>
148-
<Command>powershell.exe -Executionpolicy Bypass "$(SolutionDir)config.ps1" -Config_h_vs '$(SolutionDir)config.h.vs' -Config_h '$(OpenSSH-Src-Path)config.h' -VCIncludePath '$(VC_IncludePath)' -OutCRTHeader '$(OpenSSH-Src-Path)contrib\win32\win32compat\inc\crtheaders.h'</Command>
148+
<Command>powershell.exe -Executionpolicy Bypass -File "$(SolutionDir)config.ps1" -Config_h_vs "$(SolutionDir)config.h.vs" -Config_h "$(OpenSSH-Src-Path)config.h" -VCIncludePath "$(VC_IncludePath)" -OutCRTHeader "$(OpenSSH-Src-Path)contrib\win32\win32compat\inc\crtheaders.h"</Command>
149149
</PreBuildEvent>
150150
<PreBuildEvent>
151151
<Message>Generate crtheaders.h and config.h</Message>
152152
</PreBuildEvent>
153153
<PostBuildEvent>
154-
<Command>copy /Y $(SolutionDir)install-ssh*ps1 $(OutDir)
155-
copy /Y $(SolutionDir)uninstall-ssh*ps1 $(OutDir)
156-
copy /Y $(SolutionDir)OpenSSHUtils.ps*1 $(OutDir)
157-
copy /Y $(SolutionDir)Fix*FilePermissions.ps1 $(OutDir)
158-
copy /Y $(SolutionDir)ssh-add-hostkey.ps1 $(OutDir)
159-
If NOT exist $(OutDir)\sshd_config (copy $(SolutionDir)sshd_config $(OutDir))</Command>
154+
<Command>copy /Y "$(SolutionDir)install-ssh*ps1" "$(OutDir)"
155+
copy /Y "$(SolutionDir)uninstall-ssh*ps1" "$(OutDir)"
156+
copy /Y "$(SolutionDir)OpenSSHUtils.ps*1" "$(OutDir)"
157+
copy /Y "$(SolutionDir)Fix*FilePermissions.ps1" "$(OutDir)"
158+
copy /Y "$(SolutionDir)ssh-add-hostkey.ps1" "$(OutDir)"
159+
If NOT exist "$(OutDir)\sshd_config" (copy "$(SolutionDir)sshd_config" "$(OutDir)")</Command>
160160
<Message>Copy install-sshd.ps1, uninstall-sshd.ps1, OpenSSHUtils.psm1, OpenSSHUtils.psd1, FixHostFilePermissions.ps1, FixUserFilePermissions.ps1, ssh-add-hostkey.ps1, and sshd_config (if not already present) to build directory</Message>
161161
</PostBuildEvent>
162162
</ItemDefinitionGroup>
@@ -182,18 +182,18 @@ If NOT exist $(OutDir)\sshd_config (copy $(SolutionDir)sshd_config $(OutDir))</C
182182
<AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(LibreSSL-x86-Path);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
183183
</Link>
184184
<PreBuildEvent>
185-
<Command>powershell.exe -Executionpolicy Bypass "$(SolutionDir)config.ps1" -Config_h_vs '$(SolutionDir)config.h.vs' -Config_h '$(OpenSSH-Src-Path)config.h' -VCIncludePath '$(VC_IncludePath)' -OutCRTHeader '$(OpenSSH-Src-Path)contrib\win32\win32compat\inc\crtheaders.h'</Command>
185+
<Command>powershell.exe -Executionpolicy Bypass -File "$(SolutionDir)config.ps1" -Config_h_vs "$(SolutionDir)config.h.vs" -Config_h "$(OpenSSH-Src-Path)config.h" -VCIncludePath "$(VC_IncludePath)" -OutCRTHeader "$(OpenSSH-Src-Path)contrib\win32\win32compat\inc\crtheaders.h"</Command>
186186
</PreBuildEvent>
187187
<PreBuildEvent>
188188
<Message>Generate crtheaders.h and config.h</Message>
189189
</PreBuildEvent>
190190
<PostBuildEvent>
191-
<Command>copy /Y $(SolutionDir)install-ssh*ps1 $(OutDir)
192-
copy /Y $(SolutionDir)uninstall-ssh*ps1 $(OutDir)
193-
copy /Y $(SolutionDir)OpenSSHUtils.ps*1 $(OutDir)
194-
copy /Y $(SolutionDir)Fix*FilePermissions.ps1 $(OutDir)
195-
copy /Y $(SolutionDir)ssh-add-hostkey.ps1 $(OutDir)
196-
If NOT exist $(OutDir)\sshd_config (copy $(SolutionDir)sshd_config $(OutDir))</Command>
191+
<Command>copy /Y "$(SolutionDir)install-ssh*ps1" "$(OutDir)"
192+
copy /Y "$(SolutionDir)uninstall-ssh*ps1" "$(OutDir)"
193+
copy /Y "$(SolutionDir)OpenSSHUtils.ps*1" "$(OutDir)"
194+
copy /Y "$(SolutionDir)Fix*FilePermissions.ps1" "$(OutDir)"
195+
copy /Y "$(SolutionDir)ssh-add-hostkey.ps1" "$(OutDir)"
196+
If NOT exist "$(OutDir)\sshd_config" (copy "$(SolutionDir)sshd_config" "$(OutDir)")</Command>
197197
<Message>Copy install-sshd.ps1, uninstall-sshd.ps1, OpenSSHUtils.psm1, OpenSSHUtils.psd1, FixHostFilePermissions.ps1, FixUserFilePermissions.ps1, ssh-add-hostkey.ps1, and sshd_config (if not already present) to build directory</Message>
198198
</PostBuildEvent>
199199
</ItemDefinitionGroup>
@@ -219,18 +219,18 @@ If NOT exist $(OutDir)\sshd_config (copy $(SolutionDir)sshd_config $(OutDir))</C
219219
<AdditionalLibraryDirectories>$(OpenSSH-Lib-Path)$(Platform)\$(Configuration);$(LibreSSL-x64-Path);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
220220
</Link>
221221
<PreBuildEvent>
222-
<Command>powershell.exe -Executionpolicy Bypass "$(SolutionDir)config.ps1" -Config_h_vs '$(SolutionDir)config.h.vs' -Config_h '$(OpenSSH-Src-Path)config.h' -VCIncludePath '$(VC_IncludePath)' -OutCRTHeader '$(OpenSSH-Src-Path)contrib\win32\win32compat\inc\crtheaders.h'</Command>
222+
<Command>powershell.exe -Executionpolicy Bypass -File "$(SolutionDir)config.ps1" -Config_h_vs "$(SolutionDir)config.h.vs" -Config_h "$(OpenSSH-Src-Path)config.h" -VCIncludePath "$(VC_IncludePath)" -OutCRTHeader "$(OpenSSH-Src-Path)contrib\win32\win32compat\inc\crtheaders.h"</Command>
223223
</PreBuildEvent>
224224
<PreBuildEvent>
225225
<Message>Generate crtheaders.h and config.h</Message>
226226
</PreBuildEvent>
227227
<PostBuildEvent>
228-
<Command>copy /Y $(SolutionDir)install-ssh*ps1 $(OutDir)
229-
copy /Y $(SolutionDir)uninstall-ssh*ps1 $(OutDir)
230-
copy /Y $(SolutionDir)OpenSSHUtils.ps*1 $(OutDir)
231-
copy /Y $(SolutionDir)Fix*FilePermissions.ps1 $(OutDir)
232-
copy /Y $(SolutionDir)ssh-add-hostkey.ps1 $(OutDir)
233-
If NOT exist $(OutDir)\sshd_config (copy $(SolutionDir)sshd_config $(OutDir))</Command>
228+
<Command>copy /Y "$(SolutionDir)install-ssh*ps1" "$(OutDir)"
229+
copy /Y "$(SolutionDir)uninstall-ssh*ps1" "$(OutDir)"
230+
copy /Y "$(SolutionDir)OpenSSHUtils.ps*1" "$(OutDir)"
231+
copy /Y "$(SolutionDir)Fix*FilePermissions.ps1" "$(OutDir)"
232+
copy /Y "$(SolutionDir)ssh-add-hostkey.ps1" "$(OutDir)"
233+
If NOT exist "$(OutDir)\sshd_config" (copy "$(SolutionDir)sshd_config" "$(OutDir)")</Command>
234234
<Message>Copy install-sshd.ps1, uninstall-sshd.ps1, OpenSSHUtils.psm1, OpenSSHUtils.psd1, FixHostFilePermissions.ps1, FixUserFilePermissions.ps1, ssh-add-hostkey.ps1, and sshd_config (if not already present) to build directory</Message>
235235
</PostBuildEvent>
236236
</ItemDefinitionGroup>
@@ -240,4 +240,4 @@ If NOT exist $(OutDir)\sshd_config (copy $(SolutionDir)sshd_config $(OutDir))</C
240240
<Target Name="BeforeClean">
241241
<Delete Files="$(OpenSSH-Src-Path)contrib\win32\win32compat\inc\crtheaders.h" />
242242
</Target>
243-
</Project>
243+
</Project>

contrib/win32/openssh/install-sshd.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,13 +255,13 @@ if (-not (Test-Path $sshdpath)) {
255255
if (Get-Service sshd -ErrorAction SilentlyContinue)
256256
{
257257
Stop-Service sshd
258-
sc.exe delete sshd 1> null
258+
sc.exe delete sshd 1>$null
259259
}
260260

261261
if (Get-Service ssh-agent -ErrorAction SilentlyContinue)
262262
{
263263
Stop-Service ssh-agent
264-
sc.exe delete ssh-agent 1> null
264+
sc.exe delete ssh-agent 1>$null
265265
}
266266

267267
New-Service -Name ssh-agent -BinaryPathName $sshagentpath -Description "SSH Agent" -StartupType Manual | Out-Null
@@ -272,6 +272,7 @@ sc.exe config sshd obj= $sshdAccount
272272
sc.exe privs sshd SeAssignPrimaryTokenPrivilege
273273

274274
Add-Privilege -Account $sshdSid -Privilege SeAssignPrimaryTokenPrivilege
275+
Add-Privilege -Account $sshdSid -Privilege SeServiceLogonRight
275276

276277
if(-not (test-path $logsdir -PathType Container))
277278
{
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
if (Get-Service sshd -ErrorAction SilentlyContinue)
22
{
33
Stop-Service sshd
4-
sc.exe delete sshd 1> null
4+
sc.exe delete sshd 1>$null
55
Write-Host -ForegroundColor Green "sshd successfully uninstalled"
66
}
77
else {
@@ -11,12 +11,9 @@ else {
1111
if (Get-Service ssh-agent -ErrorAction SilentlyContinue)
1212
{
1313
Stop-Service ssh-agent
14-
sc.exe delete ssh-agent 1>null
14+
sc.exe delete ssh-agent 1>$null
1515
Write-Host -ForegroundColor Green "ssh-agent successfully uninstalled"
1616
}
1717
else {
1818
Write-Host -ForegroundColor Yellow "ssh-agent service is not installed"
1919
}
20-
21-
22-

contrib/win32/openssh/unittest-hostkeys.vcxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<AdditionalManifestFiles>targetos.manifest</AdditionalManifestFiles>
124124
</Manifest>
125125
<PostBuildEvent>
126-
<Command>xcopy /Y $(ProjectDir)..\..\..\regress\unittests\hostkeys\testdata\* $(OutDir)</Command>
126+
<Command>xcopy /Y "$(ProjectDir)..\..\..\regress\unittests\hostkeys\testdata\*" "$(OutDir)"</Command>
127127
</PostBuildEvent>
128128
</ItemDefinitionGroup>
129129
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
@@ -149,7 +149,7 @@
149149
<AdditionalManifestFiles>targetos.manifest</AdditionalManifestFiles>
150150
</Manifest>
151151
<PostBuildEvent>
152-
<Command>xcopy /Y $(ProjectDir)..\..\..\regress\unittests\hostkeys\testdata\* $(OutDir)</Command>
152+
<Command>xcopy /Y "$(ProjectDir)..\..\..\regress\unittests\hostkeys\testdata\*" "$(OutDir)"</Command>
153153
</PostBuildEvent>
154154
</ItemDefinitionGroup>
155155
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -177,7 +177,7 @@
177177
<AdditionalManifestFiles>targetos.manifest</AdditionalManifestFiles>
178178
</Manifest>
179179
<PostBuildEvent>
180-
<Command>xcopy /Y $(ProjectDir)..\..\..\regress\unittests\hostkeys\testdata\* $(OutDir)</Command>
180+
<Command>xcopy /Y "$(ProjectDir)..\..\..\regress\unittests\hostkeys\testdata\*" "$(OutDir)"</Command>
181181
</PostBuildEvent>
182182
</ItemDefinitionGroup>
183183
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@@ -206,7 +206,7 @@
206206
<AdditionalManifestFiles>targetos.manifest</AdditionalManifestFiles>
207207
</Manifest>
208208
<PostBuildEvent>
209-
<Command>xcopy /Y $(ProjectDir)..\..\..\regress\unittests\hostkeys\testdata\* $(OutDir)</Command>
209+
<Command>xcopy /Y "$(ProjectDir)..\..\..\regress\unittests\hostkeys\testdata\*" "$(OutDir)"</Command>
210210
</PostBuildEvent>
211211
</ItemDefinitionGroup>
212212
<ItemGroup>

0 commit comments

Comments
 (0)