• R/O
  • HTTP
  • SSH
  • HTTPS

MUtilities: 提交

MUtilities development repository


Commit MetaInfo

修订版61b1167ab373533f4fa7895754c73adc4ad08ca6 (tree)
时间2021-06-20 05:21:23
作者LoRd_MuldeR <mulder2@gmx....>
CommiterLoRd_MuldeR

Log Message

Correctly set environment variable CURL_CA_BUNDLE.

更改概述

差异

--- a/src/UpdateChecker.cpp
+++ b/src/UpdateChecker.cpp
@@ -102,12 +102,14 @@ static QQueue<QString> buildRandomList(const char *const *values)
102102 return list;
103103 }
104104
105-static const QHash<QString, QString> *initEnvVars(void)
105+static const QHash<QString, QString> *initEnvVars(const QString &binCurl)
106106 {
107- const QString tempfolder = QDir::toNativeSeparators(MUtils::temp_folder());
108107 QHash<QString, QString> *const environment = new QHash<QString, QString>();
108+ const QString tempfolder = QDir::toNativeSeparators(MUtils::temp_folder());
109109 environment->insert(QLatin1String("CURL_HOME"), tempfolder);
110110 environment->insert(QLatin1String("GNUPGHOME"), tempfolder);
111+ const QFileInfo curlFile(binCurl);
112+ environment->insert(QLatin1String("CURL_CA_BUNDLE"), QDir::toNativeSeparators(curlFile.absoluteDir().absoluteFilePath(QString("%1.crt").arg(curlFile.completeBaseName()))));
111113 return environment;
112114 }
113115
@@ -152,12 +154,12 @@ MUtils::UpdateChecker::UpdateChecker(const QString &binCurl, const QString &binG
152154 m_binaryCurl(binCurl),
153155 m_binaryGnuPG(binGnuPG),
154156 m_binaryKeys(binKeys),
157+ m_environment(initEnvVars(binCurl)),
155158 m_applicationId(applicationId),
156159 m_installedBuildNo(installedBuildNo),
157160 m_betaUpdates(betaUpdates),
158161 m_testMode(testMode),
159- m_maxProgress(MIN_CONNSCORE + 5),
160- m_environment(initEnvVars())
162+ m_maxProgress(MIN_CONNSCORE + 5)
161163 {
162164 m_status = UpdateStatus_NotStartedYet;
163165 m_progress = 0;
@@ -605,7 +607,7 @@ bool MUtils::UpdateChecker::getFile(const QUrl &url, const QString &outFile, con
605607 }
606608 }
607609
608- QStringList args(QLatin1String("-vsSNqkfL"));
610+ QStringList args(QLatin1String("-vsSNqfL"));
609611 args << "-m" << QString::number(DOWNLOAD_TIMEOUT / 1000);
610612 args << "--max-redirs" << QString::number(maxRedir);
611613 args << "-A" << USER_AGENT_STR;
Show on old repository browser