From b938c41067db6057433b536b48650f7536e12839 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Tue, 19 Aug 2014 00:12:05 +0200 Subject: [PATCH] Provide file permissions for newly created file Since O_CREAT is passed, we have to provide permission flags too. --- src/utilities.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities.cpp b/src/utilities.cpp index cb3f2e6..527acf4 100644 --- a/src/utilities.cpp +++ b/src/utilities.cpp @@ -92,7 +92,7 @@ constexpr int writeOpenFlags = bool writeStringToFile(string const& filename, string const& data) { // Open temporary file. string tempname = filename + '~'; - int fd = open(tempname.c_str(), writeOpenFlags); + int fd = open(tempname.c_str(), writeOpenFlags, S_IRUSR | S_IWUSR); if (fd < 0) { return false; }