Skip to content

Commit 52f8ba1

Browse files
authored
Merge pull request #615 from PaulHigin/fix-testhelper
Fix sshd executable name and resolve source path.
2 parents 04dd589 + 0fd0ac6 commit 52f8ba1

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

contrib/win32/openssh/OpenSSHTestHelper.psm1

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ WARNING: Following changes will be made to OpenSSH configuration
146146
Get-ChildItem $testSvcConfigDir | foreach {$acl | set-acl $_.FullName}
147147

148148

149-
$SSHDTestSvcNameCmdLine = (Join-Path $script:OpenSSHBinPath sshd) + " -f " + $testSshdConfig
149+
$SSHDTestSvcNameCmdLine = (Join-Path $script:OpenSSHBinPath 'sshd.exe') + " -f " + $testSshdConfig
150150
New-Service -Name $SSHDTestSvcName -DisplayName "OpenSSH SSH Test Server for E2E tests" -BinaryPathName $SSHDTestSvcNameCmdLine -StartupType Manual | Out-Null
151151
sc.exe privs $SSHDTestSvcName SeAssignPrimaryTokenPrivilege/SeTcbPrivilege/SeBackupPrivilege/SeRestorePrivilege/SeImpersonatePrivilege
152152

@@ -317,14 +317,12 @@ function Set-BasicTestInfo
317317
}
318318
else
319319
{
320-
if (-not (Test-Path (Join-Path $OpenSSHBinPath ssh.exe) -PathType Leaf))
320+
$script:OpenSSHBinPath = (Resolve-Path -Path $OpenSSHBinPath -ErrorAction Stop).Path
321+
322+
if (-not (Test-Path (Join-Path $script:OpenSSHBinPath ssh.exe) -PathType Leaf))
321323
{
322324
Throw "Cannot find OpenSSH binaries under $OpenSSHBinPath. Please specify -OpenSSHBinPath to the OpenSSH installed location"
323325
}
324-
else
325-
{
326-
$script:OpenSSHBinPath = $OpenSSHBinPath
327-
}
328326
}
329327

330328
$Global:OpenSSHTestInfo.Add("OpenSSHBinPath", $script:OpenSSHBinPath)

0 commit comments

Comments
 (0)