From 0f1b6aea1fc7a2753cfde98a74c1ab74e258576e Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 27 Dec 2015 09:45:56 +0100 Subject: Explicitly set log file permissions This ensures that the log file is actually accessable - there was a problem where e.g. `change rm test` did not create the log file correctly. --- src/utility/io.h | 2 +- src/utility/logger.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/utility') diff --git a/src/utility/io.h b/src/utility/io.h index ed1f542..32d6ecb 100644 --- a/src/utility/io.h +++ b/src/utility/io.h @@ -13,7 +13,7 @@ namespace utility { class FileDescriptorGuard { public: FileDescriptorGuard(const std::string& path) { - this->fd_ = open(path.c_str(), O_CREAT | O_WRONLY | O_APPEND); + this->fd_ = open(path.c_str(), O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); if ( !this->fd_ ) { this->fd_ = STDERR_FILENO; diff --git a/src/utility/logger.h b/src/utility/logger.h index 475f33d..e21f6fd 100644 --- a/src/utility/logger.h +++ b/src/utility/logger.h @@ -5,8 +5,6 @@ #include -#include - namespace utility { class Logger { -- cgit v1.2.3