diff --git a/src/gui/src/CommandProcess.cpp b/src/gui/src/CommandProcess.cpp index ce239129..e1b4a7e4 100644 --- a/src/gui/src/CommandProcess.cpp +++ b/src/gui/src/CommandProcess.cpp @@ -32,7 +32,7 @@ QString CommandProcess::run() QProcess process; process.setReadChannel(QProcess::StandardOutput); process.start(m_Command, m_Arguments); - bool success = process.waitForFinished(); + bool success = process.waitForStarted(); QString output, error; if (success) diff --git a/src/gui/src/QUtility.cpp b/src/gui/src/QUtility.cpp index 8be55c18..dcc8f5eb 100644 --- a/src/gui/src/QUtility.cpp +++ b/src/gui/src/QUtility.cpp @@ -18,7 +18,7 @@ #include "QUtility.h" #include "ProcessorArch.h" -#include "CommandProcess" +#include "CommandProcess.h" #if defined(Q_OS_LINUX) #include @@ -94,18 +94,20 @@ qProcessorArch getProcessorArch() QString getOSInformation() { - QString output; + QString result; #if defined(Q_OS_LINUX) - CommandProcess cp("/bin/cat", "/etc/os-release"); + QStringList arguments; + arguments.append("/etc/os-release"); + CommandProcess cp("/bin/cat", arguments); QString output = cp.run(); - QRegExp resultRegex(".*PRETTY_NAME=\".*\".*"); + QRegExp resultRegex(".*PRETTY_NAME=\"([^\"]+)\".*"); if (resultRegex.exactMatch(output)) { QString OSInfo = resultRegex.cap(1); - output = OSInfo; + result = OSInfo; } #endif - return output; + return result; } diff --git a/src/gui/src/WebClient.cpp b/src/gui/src/WebClient.cpp index c231c970..9362c008 100644 --- a/src/gui/src/WebClient.cpp +++ b/src/gui/src/WebClient.cpp @@ -94,6 +94,12 @@ QString WebClient::request( { QStringList args("--login-auth"); // hash password in case it contains interesting chars. - QString credentials(email + ":" + hash(password) + ":" + hash(getFirstMacAddress()) + "\n"); + QString credentials(email + ":" + hash(password) + ":" + hash(getFirstMacAddress())); + QString os= getOSInformation(); + if (!os.isEmpty()) { + credentials.append(":").append(os); + } + credentials.append("\n"); + return m_CoreInterface.run(args, credentials); }