mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-29 00:34:33 +02:00
Fixed fileio_fdopen() to simply return the file descriptor for non-disk file types
Addresses issue where an error message in SCP (server side) was not being returned to the pipe which causes the process to hang. Resolves: https://github.com/PowerShell/Win32-OpenSSH/issues/1345
This commit is contained in:
parent
3449eb2152
commit
22cc95e986
@ -918,12 +918,19 @@ fileio_fdopen(struct w32_io* pio, const char *mode)
|
|||||||
{
|
{
|
||||||
wchar_t *file_path, *wmode = NULL;
|
wchar_t *file_path, *wmode = NULL;
|
||||||
FILE* ret = NULL;
|
FILE* ret = NULL;
|
||||||
|
DWORD type = 0;
|
||||||
|
|
||||||
debug4("fdopen - io:%p", pio);
|
debug4("fdopen - io:%p", pio);
|
||||||
|
|
||||||
if ((wmode = utf8_to_utf16(mode)) == NULL)
|
if ((wmode = utf8_to_utf16(mode)) == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
/* for non-disk files, just return the descriptor */
|
||||||
|
type = GetFileType(pio->handle);
|
||||||
|
if (type != FILE_TYPE_DISK) {
|
||||||
|
return _fdopen(pio->table_index, mode);
|
||||||
|
}
|
||||||
|
|
||||||
file_path = get_final_path_by_handle(pio->handle);
|
file_path = get_final_path_by_handle(pio->handle);
|
||||||
if (!file_path)
|
if (!file_path)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user