Avoid reading or writing the configuration file if we don't have access to it. In particular this helps prevent the seccomp-bpf sandbox from shutting things down. crbug.com/336438
diff --git a/src/Common/Configurator.cpp b/src/Common/Configurator.cpp index 2956bf8..94fbe68 100644 --- a/src/Common/Configurator.cpp +++ b/src/Common/Configurator.cpp
@@ -35,6 +35,13 @@ bool Configurator::readFile() { + #if defined(__unix__) + if(access(path.c_str(), R_OK) != 0) + { + return false; + } + #endif + fstream file(path.c_str(), ios::in); if(file.fail()) return false; @@ -102,6 +109,13 @@ void Configurator::writeFile(std::string title) { + #if defined(__unix__) + if(access(path.c_str(), W_OK) != 0) + { + return; + } + #endif + fstream file(path.c_str(), ios::out); if(file.fail()) return;
diff --git a/src/Common/Version.h b/src/Common/Version.h index 229944b..7c295ad 100644 --- a/src/Common/Version.h +++ b/src/Common/Version.h
@@ -1,7 +1,7 @@ #define MAJOR_VERSION 3 #define MINOR_VERSION 2 #define BUILD_VERSION 6 -#define BUILD_REVISION 47297 +#define BUILD_REVISION 47312 #define STRINGIFY(x) #x #define MACRO_STRINGIFY(x) STRINGIFY(x)