Browse Source

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.
pull/51/head
Duke Leto 5 years ago
parent
commit
f3091936e1
  1. 3
      src/util.cpp

3
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 <char> vch(200000,0);

Loading…
Cancel
Save