diff --git a/chain/wallet/handlers/DapAbstractCommand.cpp b/chain/wallet/handlers/DapAbstractCommand.cpp index c6c2aaf9baa8c8839bf9705868b7e485d18eecd2..f96c37b5de1b671847022785d6edd7139321917f 100644 --- a/chain/wallet/handlers/DapAbstractCommand.cpp +++ b/chain/wallet/handlers/DapAbstractCommand.cpp @@ -135,6 +135,13 @@ QVariant DapAbstractCommand::respondToClient(const QVariant &args) } //Q_UNUSED(args) +// if(listArgs.count() >= 3) + if(this->getName() == "DapAddWalletCommand") + { + if(listArgs.count() > 3) + listArgs[3] = "****"; //hide pass in logs + } + qDebug() << "[" << this->getName() << "] [respondToClient] " << listArgs; return QVariant(); } diff --git a/chain/wallet/handlers/DapCommandList.cpp b/chain/wallet/handlers/DapCommandList.cpp index 62f7eee480864cb75987206f30c1945d1dc9bcd2..b67bb76e71fcab3093b71f64f7b77e90fa1cdc23 100644 --- a/chain/wallet/handlers/DapCommandList.cpp +++ b/chain/wallet/handlers/DapCommandList.cpp @@ -1405,13 +1405,21 @@ bool DapCommandList::checkContentLenght(QString body) QVariant DapCommandList::requestToNodeCLI(QPair<QString*, QString> cmd) { + QStringList args = cmd.second.split(" "); QProcess process; process.setProgram(*cmd.first); - process.setArguments(cmd.second.split(" ")); + process.setArguments(args); process.start(); /// TODO: if you need a list of output commands, then uncomment. /// In the usual case, it is better to avoid this because it causes logging redundancy. - qDebug()<< process.program() << "command:" << process.arguments(); + if(args.contains("-password")) + { + int idx = args.indexOf("-password"); + if(args.count() >= idx+1) + args[idx+1] = "****"; + } + + qDebug()<< process.program() << "command:" << args; int attempt_count = 5; @@ -1428,7 +1436,7 @@ QVariant DapCommandList::requestToNodeCLI(QPair<QString*, QString> cmd) attempt_count--; } - qWarning() << QString("Timeout request: %1. Error string: %2. Error number: %3.").arg(cmd.second).arg(process.errorString()).arg(process.error()); + qWarning() << "Timeout request: " << args << QString("Error string: %2. Error number: %3.").arg(process.errorString()).arg(process.error()); return QString(); }