From 65e36fc20f3aa6ab4c341aa4d75c04a053ab038d Mon Sep 17 00:00:00 2001 From: Johann Rudloff Date: Sun, 10 Jan 2021 11:54:15 +0100 Subject: [PATCH] Better default permissions for created directories Change the support code for directory creation so that it sets all permission bits (ugo=rwx). The process's currently active umask will be subtracted from these permissions, which leads to the result that (for a standard umask of "022") directories are created with a mode of "0755". So by default, directories created with `prim__createDir` are now also group-executable and other-executable by default. Previous behaviour was to create the directories readable for group and other, but not executable (mode "744"), and thus inaccessible to anyone except the owner. --- support/c/idris_directory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/c/idris_directory.c b/support/c/idris_directory.c index 2f7d735a1..0c9dbfe25 100644 --- a/support/c/idris_directory.c +++ b/support/c/idris_directory.c @@ -19,7 +19,7 @@ int idris2_createDir(char* dir) { #ifdef _WIN32 return mkdir(dir); #else - return mkdir(dir, S_IRWXU | S_IRGRP | S_IROTH); + return mkdir(dir, S_IRWXU | S_IRWXG | S_IRWXO); #endif }