From a5ad78654e629f4c8e7d87bb8034ef6e4d086cf6 Mon Sep 17 00:00:00 2001 From: hiker Date: Fri, 10 Oct 2014 09:40:19 +1100 Subject: [PATCH] Remove data after "-" when using uname (which could theoretically be used to identify a system). --- src/config/hardware_stats.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/config/hardware_stats.cpp b/src/config/hardware_stats.cpp index 532f98211..9e69bc3e1 100644 --- a/src/config/hardware_stats.cpp +++ b/src/config/hardware_stats.cpp @@ -175,7 +175,10 @@ void determineOSVersion() m_os_version = "Linux unknown"; return; } - m_os_version = std::string(u.sysname) + " " + u.release; + // Ignore data after "-", since it could identify a system (self compiled + // kernels). + std::vector l = StringUtils::split(std::string(u.release),'-'); + m_os_version = std::string(u.sysname) + " " + l[0]; #endif @@ -186,7 +189,10 @@ void determineOSVersion() m_os_version = "BSD unknown"; return; } - m_os_version = std::string(u.sysname) + " " + u.release; + // Ignore data after "-", since it could identify a system (self compiled + // kernels). + std::vector l = StringUtils::split(std::string(u.release),'-'); + m_os_version = std::string(u.sysname) + " " + l[0]; #endif #ifdef WIN32