Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/win32/win32compat/w32fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1071,7 +1071,7 @@ spawn_child_internal(const char* cmd, char *const argv[], HANDLE in, HANDLE out,
si.hStdError = err;
si.dwFlags = STARTF_USESTDHANDLES;

if (strstr(cmd, "sshd.exe")) {
if (strstr(cmd, "sshd-session.exe")) {
flags |= DETACHED_PROCESS;
}

Expand Down
30 changes: 28 additions & 2 deletions regress/pesterTests/SSH.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,41 @@ Describe "E2E scenarios for ssh client" -Tags "CI" {
$o | Should Be `$env:computername
}
}

Context "$tC - configure powershell as default shell with admin user" {
BeforeAll {
$tI=1
$shell_path = (Get-Command powershell.exe -ErrorAction SilentlyContinue).path
if ($shell_path -ne $null) {
ConfigureDefaultShell -default_shell_path $shell_path -default_shell_cmd_option_val "-c"
}
$password = $OpenSSHTestInfo['TestAccountPW']
Add-PasswordSetting -Pass $password
}
AfterAll {
$tC++
Remove-ItemProperty -Path $dfltShellRegPath -Name $dfltShellRegKeyName -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $dfltShellRegPath -Name $dfltShellCmdOptionRegKeyName -ErrorAction SilentlyContinue
Remove-PasswordSetting
}

It "$tC.$tI - admin session can write to console" -skip:$skip {
$adminusername = $OpenSSHTestInfo['AdminUser']
$o = ssh $adminusername@test_target "Get-ComputerInfo"
$LASTEXITCODE | Should Be 0
$o | Select-String -Pattern "WindowsVersion" | Should Match "WindowsVersion"
}
}

Context "$tC - configure cmd as default shell" {
BeforeAll {
$tI=1
$shell_path = (Get-Command cmd.exe -ErrorAction SilentlyContinue).path
if($shell_path -ne $null) {
ConfigureDefaultShell -default_shell_path $shell_path -default_shell_cmd_option_val "/c"
}
}
}
AfterAll{
AfterAll {
$tC++
Remove-ItemProperty -Path $dfltShellRegPath -Name $dfltShellRegKeyName -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $dfltShellRegPath -Name $dfltShellCmdOptionRegKeyName -ErrorAction SilentlyContinue
Expand Down