From efa9c265c4a0de4df488325914b77be50ccce6e3 Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Thu, 23 Mar 2017 18:13:09 -0700 Subject: [PATCH 1/4] Add security warning to zcash-cli --help and --version message output --- src/bitcoin-cli.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 0e692622b..868bf3c66 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -65,6 +65,7 @@ static bool AppInitRPC(int argc, char* argv[]) ParseParameters(argc, argv); if (argc<2 || mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) { std::string strUsage = _("Zcash RPC client version") + " " + FormatFullVersion() + "\n"; + strUsage += "\n" + _("In order to ensure you are adequately protecting your privacy when using Zcash, please see https://z.cash/support/security.html") + "\n"; if (!mapArgs.count("-version")) { strUsage += "\n" + _("Usage:") + "\n" + " zcash-cli [options] [params] " + _("Send command to Zcash") + "\n" + From 54c0a2812300408c11b162885378608269e5a262 Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Thu, 23 Mar 2017 18:13:37 -0700 Subject: [PATCH 2/4] Add security warning to zcashd metrics display --- src/bitcoin-cli.cpp | 2 +- src/metrics.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 868bf3c66..52f4be4e4 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -65,7 +65,7 @@ static bool AppInitRPC(int argc, char* argv[]) ParseParameters(argc, argv); if (argc<2 || mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) { std::string strUsage = _("Zcash RPC client version") + " " + FormatFullVersion() + "\n"; - strUsage += "\n" + _("In order to ensure you are adequately protecting your privacy when using Zcash, please see https://z.cash/support/security.html") + "\n"; + strUsage += "\n" + _("In order to ensure you are adequately protecting your privacy when using Zcash, please see https://z.cash/support/security/index.html") + "\n"; if (!mapArgs.count("-version")) { strUsage += "\n" + _("Usage:") + "\n" + " zcash-cli [options] [params] " + _("Send command to Zcash") + "\n" + diff --git a/src/metrics.cpp b/src/metrics.cpp index b63fd16ea..fda94788e 100644 --- a/src/metrics.cpp +++ b/src/metrics.cpp @@ -330,6 +330,10 @@ void ThreadShowMetricsScreen() // Thank you text std::cout << _("Thank you for running a Zcash node!") << std::endl; std::cout << _("You're helping to strengthen the network and contributing to a social good :)") << std::endl; + + // Security warning text + std::cout << std::endl; + std::cout << _("In order to ensure you are adequately protecting your privacy when using Zcash, please see https://z.cash/support/security/index.html") << std::endl; std::cout << std::endl; } From ab1d2d575c40fd15748ef87cfc21d06d5917f4e1 Mon Sep 17 00:00:00 2001 From: Jay Graber Date: Fri, 24 Mar 2017 13:48:27 -0700 Subject: [PATCH 3/4] Add security message to license text, rm url from translation string --- src/bitcoin-cli.cpp | 3 ++- src/metrics.cpp | 2 +- src/util.cpp | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 52f4be4e4..a023daef6 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -65,8 +65,9 @@ static bool AppInitRPC(int argc, char* argv[]) ParseParameters(argc, argv); if (argc<2 || mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) { std::string strUsage = _("Zcash RPC client version") + " " + FormatFullVersion() + "\n"; - strUsage += "\n" + _("In order to ensure you are adequately protecting your privacy when using Zcash, please see https://z.cash/support/security/index.html") + "\n"; if (!mapArgs.count("-version")) { + strUsage += "\n" + strprintf(_("In order to ensure you are adequately protecting your privacy when using Zcash, please see %s"), "https://z.cash/support/security/index.html") + "\n"; + strUsage += "\n" + _("Usage:") + "\n" + " zcash-cli [options] [params] " + _("Send command to Zcash") + "\n" + " zcash-cli [options] help " + _("List commands") + "\n" + diff --git a/src/metrics.cpp b/src/metrics.cpp index fda94788e..5bce5cf6f 100644 --- a/src/metrics.cpp +++ b/src/metrics.cpp @@ -333,7 +333,7 @@ void ThreadShowMetricsScreen() // Security warning text std::cout << std::endl; - std::cout << _("In order to ensure you are adequately protecting your privacy when using Zcash, please see https://z.cash/support/security/index.html") << std::endl; + std::cout << strprintf(_("In order to ensure you are adequately protecting your privacy when using Zcash, please see %s"), "https://z.cash/support/security/index.html") << std::endl; std::cout << std::endl; } diff --git a/src/util.cpp b/src/util.cpp index 8ce727609..e89a1c434 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -878,7 +878,8 @@ void SetThreadPriority(int nPriority) std::string LicenseInfo() { - return FormatParagraph(strprintf(_("Copyright (C) 2009-%i The Bitcoin Core Developers"), COPYRIGHT_YEAR)) + "\n" + + return "\n" + FormatParagraph(strprintf(_("In order to ensure you are adequately protecting your privacy when using Zcash, please see %s"), "https://z.cash/support/security/index.html")) + "\n" + "\n" + + FormatParagraph(strprintf(_("Copyright (C) 2009-%i The Bitcoin Core Developers"), COPYRIGHT_YEAR)) + "\n" + FormatParagraph(strprintf(_("Copyright (C) 2015-%i The Zcash Developers"), COPYRIGHT_YEAR)) + "\n" + "\n" + FormatParagraph(_("This is experimental software.")) + "\n" + From f0d1accb7dc3bbdf249aa7a0f1a21e8b16e32a76 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Sun, 26 Mar 2017 02:08:29 +0100 Subject: [PATCH 4/4] Line-wrap privacy notice. Use <> around URL and end sentence with '.'. Include privacy notice in help text for zcashd -help. Signed-off-by: Daira Hopwood --- src/bitcoin-cli.cpp | 4 +--- src/bitcoind.cpp | 2 +- src/metrics.cpp | 5 ++--- src/util.cpp | 9 ++++++++- src/util.h | 3 +++ 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index a023daef6..6d775f453 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -64,10 +64,8 @@ static bool AppInitRPC(int argc, char* argv[]) // ParseParameters(argc, argv); if (argc<2 || mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) { - std::string strUsage = _("Zcash RPC client version") + " " + FormatFullVersion() + "\n"; + std::string strUsage = _("Zcash RPC client version") + " " + FormatFullVersion() + "\n" + PrivacyInfo(); if (!mapArgs.count("-version")) { - strUsage += "\n" + strprintf(_("In order to ensure you are adequately protecting your privacy when using Zcash, please see %s"), "https://z.cash/support/security/index.html") + "\n"; - strUsage += "\n" + _("Usage:") + "\n" + " zcash-cli [options] [params] " + _("Send command to Zcash") + "\n" + " zcash-cli [options] help " + _("List commands") + "\n" + diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 2063f4c85..502cef6ac 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -68,7 +68,7 @@ bool AppInit(int argc, char* argv[]) // Process help and version before taking care about datadir if (mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) { - std::string strUsage = _("Zcash Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n"; + std::string strUsage = _("Zcash Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n" + PrivacyInfo(); if (mapArgs.count("-version")) { diff --git a/src/metrics.cpp b/src/metrics.cpp index 5bce5cf6f..6096848e1 100644 --- a/src/metrics.cpp +++ b/src/metrics.cpp @@ -331,9 +331,8 @@ void ThreadShowMetricsScreen() std::cout << _("Thank you for running a Zcash node!") << std::endl; std::cout << _("You're helping to strengthen the network and contributing to a social good :)") << std::endl; - // Security warning text - std::cout << std::endl; - std::cout << strprintf(_("In order to ensure you are adequately protecting your privacy when using Zcash, please see %s"), "https://z.cash/support/security/index.html") << std::endl; + // Privacy notice text + std::cout << PrivacyInfo(); std::cout << std::endl; } diff --git a/src/util.cpp b/src/util.cpp index e89a1c434..fe0f2e12a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -876,9 +876,16 @@ void SetThreadPriority(int nPriority) #endif // WIN32 } +std::string PrivacyInfo() +{ + return "\n" + + FormatParagraph(strprintf(_("In order to ensure you are adequately protecting your privacy when using Zcash, please see <%s>."), + "https://z.cash/support/security/index.html")) + "\n"; +} + std::string LicenseInfo() { - return "\n" + FormatParagraph(strprintf(_("In order to ensure you are adequately protecting your privacy when using Zcash, please see %s"), "https://z.cash/support/security/index.html")) + "\n" + "\n" + + return "\n" + FormatParagraph(strprintf(_("Copyright (C) 2009-%i The Bitcoin Core Developers"), COPYRIGHT_YEAR)) + "\n" + FormatParagraph(strprintf(_("Copyright (C) 2015-%i The Zcash Developers"), COPYRIGHT_YEAR)) + "\n" + "\n" + diff --git a/src/util.h b/src/util.h index e4eea2ba1..902d42166 100644 --- a/src/util.h +++ b/src/util.h @@ -141,6 +141,9 @@ void ShrinkDebugFile(); void runCommand(const std::string& strCommand); const boost::filesystem::path GetExportDir(); +/** Returns privacy notice (for -version, -help and metrics screen) */ +std::string PrivacyInfo(); + /** Returns licensing information (for -version) */ std::string LicenseInfo();