| 1595 | } |
| 1596 | |
| 1597 | static void AlertNotify(const std::string& strMessage) |
| 1598 | { |
| 1599 | uiInterface.NotifyAlertChanged(); |
| 1600 | #if HAVE_SYSTEM |
| 1601 | std::string strCmd = gArgs.GetArg("-alertnotify", ""); |
| 1602 | if (strCmd.empty()) return; |
| 1603 | |
| 1604 | // Alert text should be plain ascii coming from a trusted source, but to |
| 1605 | // be safe we first strip anything not in safeChars, then add single quotes around |
| 1606 | // the whole string before passing it to the shell: |
| 1607 | std::string singleQuote("'"); |
| 1608 | std::string safeStatus = SanitizeString(strMessage); |
| 1609 | safeStatus = singleQuote+safeStatus+singleQuote; |
| 1610 | boost::replace_all(strCmd, "%s", safeStatus); |
| 1611 | |
| 1612 | std::thread t(runCommand, strCmd); |
| 1613 | t.detach(); // thread runs free |
| 1614 | #endif |
| 1615 | } |
| 1616 | |
| 1617 | void CChainState::CheckForkWarningConditions() |
| 1618 | { |
no test coverage detected