SftpFileTransfer: Fix error reporting

Use "-b" option of sftp command for providing batch file
instead of setting a standard input file for sftp process.

In order to fix showing the authentication dialog
we explicitly pass -o BatchMode=no before the "-b" option,
which should re-enable the interactive mode before
processing batch file.

Change-Id: Iaf3c93929c08fd61373003e394a08439d05fe27e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jarek Kobus
2022-05-30 15:19:02 +02:00
parent 1976630bbc
commit 8a1f091bf0
2 changed files with 14 additions and 17 deletions

View File

@@ -1609,8 +1609,8 @@ private:
+ ProcessArgs::quoteArgUnix(file.m_target.path()).toLocal8Bit() + '\n');
}
m_batchFile->close();
process().setStandardInputFile(m_batchFile->fileName());
process().setCommand(CommandLine(sftpBinary, fullConnectionOptions() << host()));
process().setCommand(CommandLine(sftpBinary, fullConnectionOptions()
<< "-b" << m_batchFile->fileName() << host()));
process().start();
}