mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-06 18:53:21 +01:00
Add a SECURE style flag for ThreadSafeMessageBox, which indicates that the message contains sensitive information. This keeps the message from being output to the debug log by bitcoind. Fixes a possible security risk when starting bitcoind in server mode without the 'rpcpassword' option configured, resulting in the "suggested" password being output to the debug log.
This commit is contained in:
@@ -14,6 +14,9 @@
|
||||
|
||||
static bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style)
|
||||
{
|
||||
bool fSecure = style & CClientUIInterface::SECURE;
|
||||
style &= ~CClientUIInterface::SECURE;
|
||||
|
||||
std::string strCaption;
|
||||
// Check for usage of predefined caption
|
||||
switch (style) {
|
||||
@@ -30,7 +33,8 @@ static bool noui_ThreadSafeMessageBox(const std::string& message, const std::str
|
||||
strCaption += caption; // Use supplied caption (can be empty)
|
||||
}
|
||||
|
||||
LogPrintf("%s: %s\n", strCaption, message);
|
||||
if (!fSecure)
|
||||
LogPrintf("%s: %s\n", strCaption, message);
|
||||
fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user