From c872d73dd7f481140696fa3d21172428201b782b Mon Sep 17 00:00:00 2001 From: Omar Date: Thu, 3 Oct 2019 23:54:07 +0200 Subject: [PATCH] fix linux mkpath permissions --- linux/src/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linux/src/main.cpp b/linux/src/main.cpp index 9f96c96..8fbe095 100644 --- a/linux/src/main.cpp +++ b/linux/src/main.cpp @@ -10,7 +10,7 @@ static App app; glm::vec2 g_cursor_pos; -int mkpath(const std::string& dir, mode_t mode = ALLPERMS) +int mkpath(const std::string& dir, mode_t mode = DEFFILEMODE) { struct stat sb; @@ -25,6 +25,7 @@ int mkpath(const std::string& dir, mode_t mode = ALLPERMS) mkpath(dirname(strdupa(dir.c_str())), mode); int ret = mkdir(dir.c_str(), mode); + chmod(dir.c_str(), S_IRWXU); if (ret != 0) LOG("mkdir failed with error %d on %s", errno, dir.c_str()); return ret; @@ -107,6 +108,8 @@ int main(int argc, char** args) printf("Vendor: %s\n", glGetString(GL_VENDOR)); glfwShowWindow(wnd); + umask(0); + App::I = &app; app.initLog(); app.create();