From 70343084badaca0ae8a05f2e4c150a893e929275 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 23 Aug 2022 18:57:39 +0200 Subject: [PATCH] Fix key deployment on Windows It looks like there is no way of setting a command line on Windows according to Linux rules when there is no Linux-associated device. Workaround it by using ProcessArgs explicitly. Fixes: QTCREATORBUG-28092 Change-Id: I5ce23d33547993ed7c7733809187027084ff4c3b Reviewed-by: Qt CI Bot Reviewed-by: Christian Kandeler Reviewed-by: --- src/plugins/remotelinux/publickeydeploymentdialog.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/remotelinux/publickeydeploymentdialog.cpp b/src/plugins/remotelinux/publickeydeploymentdialog.cpp index 3ba3f011d70..0fac561614c 100644 --- a/src/plugins/remotelinux/publickeydeploymentdialog.cpp +++ b/src/plugins/remotelinux/publickeydeploymentdialog.cpp @@ -119,11 +119,10 @@ PublicKeyDeploymentDialog::PublicKeyDeploymentDialog(const IDevice::ConstPtr &de args << params.host(); cmd.addArgs(args); - CommandLine execCmd; - execCmd.addArg("exec"); - execCmd.addCommandLineAsArgs({"/bin/sh", {"-c", command}}, CommandLine::Raw); + QString execCommandString("exec /bin/sh -c"); + ProcessArgs::addArg(&execCommandString, command, OsType::OsTypeLinux); + cmd.addArg(execCommandString); - cmd.addArg(execCmd.arguments()); d->m_process.setCommand(cmd); SshParameters::setupSshEnvironment(&d->m_process); d->m_process.start();