From f3091936e1cccaa496a38a39293ecd167b313771 Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Sun, 15 Dec 2019 19:53:49 -0500 Subject: [PATCH] Increase max debug.log file size to 100MB ZEC took the route of disabling this by default, so debug.log files grow without limit, in attempt to gather more data about CVE-2019-16930, which was fixed in the same emergency release as changing this default behavior. KMD has chosen to ignore that ZEC change, which I find reasonable. We take the middle path, and 10X increase the size limit. Now debug.log must hit 100MB to be resized, and potentially lose some data about attacks. --- src/util.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util.cpp b/src/util.cpp index e75ed4ca8..abffa7a0e 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -892,7 +892,8 @@ void ShrinkDebugFile() // Scroll debug.log if it's getting too big boost::filesystem::path pathLog = GetDataDir() / "debug.log"; FILE* file = fopen(pathLog.string().c_str(), "r"); - if (file && boost::filesystem::file_size(pathLog) > 10 * 1000000) + unsigned int MAX_DEBUG_LOG_SIZE = 100*(1024*1024); // 100MB + if (file && boost::filesystem::file_size(pathLog) > MAX_DEBUG_LOG_SIZE ) { // Restart the file with some of the end std::vector vch(200000,0);