MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / AlertNotify

Function AlertNotify

src/node/kernel_notifications.cpp:30–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28using util::ReplaceAll;
29
30static void AlertNotify(const std::string& strMessage)
31{
32#if HAVE_SYSTEM
33 std::string strCmd = gArgs.GetArg("-alertnotify", "");
34 if (strCmd.empty()) return;
35
36 // Alert text should be plain ascii coming from a trusted source, but to
37 // be safe we first strip anything not in safeChars, then add single quotes around
38 // the whole string before passing it to the shell:
39 std::string singleQuote("'");
40 std::string safeStatus = SanitizeString(strMessage);
41 safeStatus = singleQuote+safeStatus+singleQuote;
42 ReplaceAll(strCmd, "%s", safeStatus);
43
44 std::thread t(runCommand, strCmd);
45 t.detach(); // thread runs free
46#endif
47}
48
49namespace node {
50

Callers 1

warningSetMethod · 0.85

Calls 4

SanitizeStringFunction · 0.85
ReplaceAllFunction · 0.85
GetArgMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected