From 0efb6c3bf2112278a46930d867f6c49af662659f Mon Sep 17 00:00:00 2001 From: Manoj Ampalam Date: Wed, 21 Dec 2016 14:16:21 -0800 Subject: [PATCH 1/2] Fix to SFTP issue failing to pass in the correct commandline --- sftp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sftp.c b/sftp.c index 341410c18..9910fda3a 100644 --- a/sftp.c +++ b/sftp.c @@ -313,6 +313,7 @@ static void printf_utf8(char *fmt, ... ) { /* override mprintf */ #define mprintf(a,...) printf_utf8((a), __VA_ARGS__) +#define printf(a,...) printf_utf8((a), __VA_ARGS__) #endif /* WINDOWS */ static void @@ -2319,14 +2320,15 @@ connect_to_server(char *path, char **args, int *in, int *out) cmdlen = strlen(path) + 1; for (i = 1; args[i]; i++) - cmdlen += strlen(args[i]) + 1; + cmdlen += strlen(args[i]) + 1 + 2; full_cmd = xmalloc(cmdlen); full_cmd[0] = '\0'; strcat(full_cmd, path); for (i = 1; args[i]; i++) { - strcat(full_cmd, " "); + strcat(full_cmd, " \""); strcat(full_cmd, args[i]); + strcat(full_cmd, "\""); } /* disable inheritance on local pipe ends*/ From 5cdec2bc351ab1443cc9d8416741457615618a71 Mon Sep 17 00:00:00 2001 From: Yanbing Date: Wed, 21 Dec 2016 17:34:20 -0800 Subject: [PATCH 2/2] Enablebuildlatestw_all (#35) Update build script to download OpenSSL libs from win32_openssh --- appveyor.yml | 6 +++--- contrib/win32/openssh/build.psm1 | 36 +++++++++++++++++++++++++++++++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 727d98c39..29e689bce 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,10 +1,10 @@ -version: 0.0.4.0.{build} +version: 0.0.5.0.{build} image: Visual Studio 2015 branches: only: - - V_7_3w - - latestw_cwb + - latestw_all + - latestw_all_openssl init: - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1')) diff --git a/contrib/win32/openssh/build.psm1 b/contrib/win32/openssh/build.psm1 index 0eeff8f62..ed5ec5ab8 100644 --- a/contrib/win32/openssh/build.psm1 +++ b/contrib/win32/openssh/build.psm1 @@ -3,6 +3,7 @@ Set-StrictMode -Version Latest [string] $script:platform = $env:PROCESSOR_ARCHITECTURE [string] $script:vcPath = $null [System.IO.DirectoryInfo] $script:OpenSSHRoot = $null +[System.IO.DirectoryInfo] $script:gitRoot = $null [bool] $script:Verbose = $false [string] $script:BuildLogFile = $null @@ -268,6 +269,34 @@ function Start-SSHBootstrap } } +function Clone-Win32OpenSSH +{ + $win32OpenSSHPath = join-path $script:gitRoot "Win32-OpenSSH" + if (-not (Test-Path -Path $win32OpenSSHPath -PathType Container)) + { + Write-BuildMsg -AsInfo -Message "clone repo Win32-OpenSSH" + Push-Location $gitRoot + git clone -q --recursive https://github.com/PowerShell/Win32-OpenSSH.git $win32OpenSSHPath + Pop-Location + } + Write-BuildMsg -AsInfo -Message "pull latest from repo Win32-OpenSSH" + Push-Location $win32OpenSSHPath + git fetch -q origin + git checkout -qf L1-Prod + Pop-Location +} + +function Copy-OpenSSLSDK +{ + $sourcePath = Join-Path $script:gitRoot "Win32-OpenSSH\contrib\win32\openssh\OpenSSLSDK" + Write-BuildMsg -AsInfo -Message "copying $sourcePath" + Copy-Item -Container -Path $sourcePath -Destination $PSScriptRoot -Recurse -Force -ErrorAction SilentlyContinue -ErrorVariable e + if($e -ne $null) + { + Write-BuildMsg -AsError -ErrorAction Stop -Message "Copy OpenSSL from $sourcePath failed " + } +} + function Start-SSHBuild { [CmdletBinding(SupportsShouldProcess=$false)] @@ -286,6 +315,8 @@ function Start-SSHBuild # Get openssh-portable root $script:OpenSSHRoot = Get-Item -Path $repositoryRoot.FullName + $script:gitRoot = split-path $script:OpenSSHRoot + if($PSBoundParameters.ContainsKey("Verbose")) { @@ -302,6 +333,9 @@ function Start-SSHBuild Write-BuildMsg -AsInfo -Message "Build Log: $($script:BuildLogFile)" Start-SSHBootstrap + + Clone-Win32OpenSSH + Copy-OpenSSLSDK $msbuildCmd = "msbuild.exe" $solutionFile = Get-SolutionFile -root $repositoryRoot.FullName $cmdMsg = @("${solutionFile}", "/p:Platform=${NativeHostArch}", "/p:Configuration=${Configuration}", "/fl", "/flp:LogFile=${script:BuildLogFile}`;Append`;Verbosity=diagnostic") @@ -380,4 +414,4 @@ function Get-RepositoryRoot throw new-object System.IO.DirectoryNotFoundException("Could not find the root of the GIT repository") } -Export-ModuleMember -Function Start-SSHBuild, Get-RepositoryRoot, Get-BuildLogFile \ No newline at end of file +Export-ModuleMember -Function Start-SSHBuild, Get-RepositoryRoot, Get-BuildLogFile, Clone-Win32OpenSSH, Copy-OpenSSLSDK \ No newline at end of file