From 59a96cfee4a9e4f9a5d9660ba989b7cc2708b3d8 Mon Sep 17 00:00:00 2001 From: bagajjal Date: Tue, 4 May 2021 13:18:06 -0700 Subject: [PATCH] Update _PATH_TTY to point to the console (#506) --- contrib/win32/openssh/OpenSSHTestHelper.psm1 | 6 ++++-- contrib/win32/openssh/config.h.vs | 3 ++- regress/pesterTests/CommonUtils.psm1 | 4 +++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/contrib/win32/openssh/OpenSSHTestHelper.psm1 b/contrib/win32/openssh/OpenSSHTestHelper.psm1 index 600d0d257..b6009cdf7 100644 --- a/contrib/win32/openssh/OpenSSHTestHelper.psm1 +++ b/contrib/win32/openssh/OpenSSHTestHelper.psm1 @@ -344,10 +344,12 @@ function Get-LocalUserProfile $askpass_util = Join-Path $Script:E2ETestDirectory "utilities\askpass_util\askpass_util.exe" $env:SSH_ASKPASS=$askpass_util $env:ASKPASS_PASSWORD=$OpenSSHTestAccountsPassword + $env:SSH_ASKPASS_REQUIRE="prefer" $ret = ssh -p 47002 "$User@localhost" echo %userprofile% if ($env:DISPLAY -eq 1) { Remove-Item env:\DISPLAY } - remove-item "env:SSH_ASKPASS" -ErrorAction SilentlyContinue - Remove-item "env:ASKPASS_PASSWORD" -ErrorAction SilentlyContinue + Remove-item "env:SSH_ASKPASS" -ErrorAction SilentlyContinue + Remove-item "env:ASKPASS_PASSWORD" -ErrorAction SilentlyContinue + Remove-item "env:SSH_ASKPASS_REQUIRE" -ErrorAction SilentlyContinue } (Get-ItemProperty -Path $userProfileRegistry -Name 'ProfileImagePath').ProfileImagePath diff --git a/contrib/win32/openssh/config.h.vs b/contrib/win32/openssh/config.h.vs index 790c655fa..42c1301b0 100644 --- a/contrib/win32/openssh/config.h.vs +++ b/contrib/win32/openssh/config.h.vs @@ -1714,4 +1714,5 @@ #define FILESYSTEM_NO_BACKSLASH #define HAVE_LOCALTIME_R #define HAVE_DECL_MEMMEM 0 -#define WITH_ZLIB \ No newline at end of file +#define WITH_ZLIB +#define _PATH_TTY "conin$" \ No newline at end of file diff --git a/regress/pesterTests/CommonUtils.psm1 b/regress/pesterTests/CommonUtils.psm1 index ac08aaece..eff6779d3 100644 --- a/regress/pesterTests/CommonUtils.psm1 +++ b/regress/pesterTests/CommonUtils.psm1 @@ -100,14 +100,16 @@ function Add-PasswordSetting $askpass_util = Join-Path $PSScriptRoot "utilities\askpass_util\askpass_util.exe" $env:SSH_ASKPASS=$askpass_util $env:ASKPASS_PASSWORD=$pass + $env:SSH_ASKPASS_REQUIRE="prefer" } } function Remove-PasswordSetting { - if ($env:DISPLAY -eq 1) { Remove-Item env:\DISPLAY } + if ($env:DISPLAY -eq 1) { Remove-Item env:\DISPLAY -ErrorAction SilentlyContinue } Remove-item "env:SSH_ASKPASS" -ErrorAction SilentlyContinue Remove-item "env:ASKPASS_PASSWORD" -ErrorAction SilentlyContinue + Remove-item "env:SSH_ASKPASS_REQUIRE" -ErrorAction SilentlyContinue } $Taskfolder = "\OpenSSHTestTasks\"