Skip to content

Commit 14edc0b

Browse files
committed
chore: remove sensitive info from log and dat files
1 parent 5e2d7d6 commit 14edc0b

File tree

3 files changed

+46
-12
lines changed

3 files changed

+46
-12
lines changed

src/libs/installer/elevatedexecuteoperation.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,15 @@ int ElevatedExecuteOperation::Private::run(QStringList &arguments, const Operati
190190
//readProcessOutput should only called from this current Thread -> Qt::DirectConnection
191191
QObject::connect(process, SIGNAL(readyRead()), q, SLOT(readProcessOutput()), Qt::DirectConnection);
192192
process->start(args.front(), args.mid(1));
193-
qCDebug(QInstaller::lcInstallerInstallLog) << args.front() << "started, arguments:"
193+
if(args.contains(QLatin1String("--regkey")))
194+
{
195+
qCDebug(QInstaller::lcInstallerInstallLog) << args.front() << "started, arguments:";
196+
}
197+
else
198+
{
199+
qCDebug(QInstaller::lcInstallerInstallLog) << args.front() << "started, arguments:"
194200
<< QStringList(args.mid(1)).join(QLatin1String(" "));
201+
}
195202

196203
bool success = false;
197204
//we still like the none blocking possibility to perform this operation without threads

src/libs/installer/operationtracer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ void OperationTracer::trace(const QString &state)
107107
if (m_operation->requiresUnreplacedVariables())
108108
args = m_operation->packageManager()->replaceVariables(m_operation->arguments());
109109

110+
if(args.contains(QLatin1String("--regkey")))
111+
{
112+
args.replace(2,QLatin1String(""));
113+
args.replace(4,QLatin1String(""));
114+
}
110115
qCDebug(lcInstallerInstallLog).noquote() << QString::fromLatin1("\t- arguments: %1")
111116
.arg(args.join(QLatin1String(", ")));
112117
}

src/libs/kdtools/updateoperation.cpp

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -543,18 +543,40 @@ QDomDocument UpdateOperation::toXml() const
543543

544544
QDomElement args = doc.createElement(QLatin1String("arguments"));
545545
const QString target = m_core ? m_core->value(QInstaller::scTargetDir) : QString();
546-
Q_FOREACH (const QString &s, arguments()) {
547-
QDomElement arg = doc.createElement(QLatin1String("argument"));
548-
// Do not call cleanPath to Execute operations paths. The operation might require the
549-
// exact separators that are set in the operation call.
550-
if (name() == QLatin1String("Execute")) {
551-
arg.appendChild(doc.createTextNode(QInstaller::replacePath(s, target,
552-
QLatin1String(QInstaller::scRelocatable), false)));
553-
} else {
554-
arg.appendChild(doc.createTextNode(QInstaller::replacePath(s, target,
555-
QLatin1String(QInstaller::scRelocatable))));
546+
if(arguments().contains(QLatin1String("--regkey")))
547+
{
548+
QStringList refinedArgList = arguments();
549+
refinedArgList.replace(2,QLatin1String(""));
550+
refinedArgList.replace(4,QLatin1String(""));
551+
Q_FOREACH (const QString &s, refinedArgList) {
552+
QDomElement arg = doc.createElement(QLatin1String("argument"));
553+
// Do not call cleanPath to Execute operations paths. The operation might require the
554+
// exact separators that are set in the operation call.
555+
if (name() == QLatin1String("Execute")) {
556+
arg.appendChild(doc.createTextNode(QInstaller::replacePath(s, target,
557+
QLatin1String(QInstaller::scRelocatable), false)));
558+
} else {
559+
arg.appendChild(doc.createTextNode(QInstaller::replacePath(s, target,
560+
QLatin1String(QInstaller::scRelocatable))));
561+
}
562+
args.appendChild(arg);
563+
}
564+
}
565+
else
566+
{
567+
Q_FOREACH (const QString &s, arguments()) {
568+
QDomElement arg = doc.createElement(QLatin1String("argument"));
569+
// Do not call cleanPath to Execute operations paths. The operation might require the
570+
// exact separators that are set in the operation call.
571+
if (name() == QLatin1String("Execute")) {
572+
arg.appendChild(doc.createTextNode(QInstaller::replacePath(s, target,
573+
QLatin1String(QInstaller::scRelocatable), false)));
574+
} else {
575+
arg.appendChild(doc.createTextNode(QInstaller::replacePath(s, target,
576+
QLatin1String(QInstaller::scRelocatable))));
577+
}
578+
args.appendChild(arg);
556579
}
557-
args.appendChild(arg);
558580
}
559581
root.appendChild(args);
560582
if (m_values.isEmpty())

0 commit comments

Comments
 (0)