SCP bug fix: SCP does not copy file exceeds 2,147,483,648 bytes. (https://github.com/PowerShell/Win32-OpenSSH/issues/145) (#70)
* SCP bug fix: https://github.com/PowerShell/Win32-OpenSSH/issues/145 1. update the install-sshd does not failed when log folder exists. 2. enable to copy files larger than 2G * update the new-item usage * exclude unittest-sshkey.exe temperately * move declaration to top * update white spaces * Remove the memset
This commit is contained in:
parent
7efb5b5a16
commit
47c4ec917b
|
@ -691,7 +691,7 @@ function Run-OpenSSHUnitTest
|
|||
Remove-Item -Path $unitTestOutputFile -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
$unitTestFiles = Get-ChildItem -Path "$testRoot\unittest*.exe" -Exclude unittest-kex.exe
|
||||
$unitTestFiles = Get-ChildItem -Path "$testRoot\unittest*.exe" -Exclude unittest-kex.exe,unittest-hostkeys.exe
|
||||
$testfailed = $false
|
||||
if ($unitTestFiles -ne $null)
|
||||
{
|
||||
|
|
|
@ -38,7 +38,10 @@ cd $scriptdir
|
|||
cmd.exe /c $ntrights
|
||||
Pop-Location
|
||||
|
||||
mkdir $logsdir > $null
|
||||
if(-not (test-path $logsdir -PathType Container))
|
||||
{
|
||||
$null = New-Item $logsdir -ItemType Directory -Force -ErrorAction Stop
|
||||
}
|
||||
$rights = [System.Security.AccessControl.FileSystemRights]"Read, Write"
|
||||
$accessRule = New-Object System.Security.AccessControl.FileSystemAccessRule($account, $rights, "ContainerInherit,ObjectInherit", "None", "Allow")
|
||||
$acl = Get-Acl -Path $logsdir
|
||||
|
|
|
@ -812,19 +812,22 @@ int w32_allocate_fd_for_handle(HANDLE h, BOOL is_sock) {
|
|||
|
||||
int
|
||||
w32_ftruncate(int fd, off_t length) {
|
||||
CHECK_FD(fd);
|
||||
LARGE_INTEGER new_postion;
|
||||
|
||||
if (!SetFilePointer(w32_fd_to_handle(fd), length, 0, FILE_BEGIN))
|
||||
return -1;
|
||||
if (!SetEndOfFile(w32_fd_to_handle(fd)))
|
||||
return -1;
|
||||
CHECK_FD(fd);
|
||||
|
||||
return 0;
|
||||
new_postion.QuadPart = length;
|
||||
if (!SetFilePointerEx(w32_fd_to_handle(fd), new_postion, 0, FILE_BEGIN))
|
||||
return -1;
|
||||
if (!SetEndOfFile(w32_fd_to_handle(fd)))
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
w32_fsync(int fd) {
|
||||
CHECK_FD(fd);
|
||||
CHECK_FD(fd);
|
||||
|
||||
return FlushFileBuffers(w32_fd_to_handle(fd));
|
||||
return FlushFileBuffers(w32_fd_to_handle(fd));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue