GRTLCollaboration / GRChombo

An AMR based open-source code for numerical relativity simulations.
BSD 3-Clause "New" or "Revised" License
82 stars 53 forks source link

`FilesystemTools::mkdir_recursive` creates directories with hardcoded 0700 permissions #206

Closed mirenradia closed 2 years ago

mirenradia commented 2 years ago

As per the title, this function currently calls the POSIX mkdir() function with mode = 0700 (here).

This is inconvenient when trying to share these directories with other users and it should instead create directories by subtracting the user mask (the value returned from the umask command) from 0777 == (S_IRWXU | S_IRWXG | S_IRWXO) (we should also use these macros rather than digits).

mirenradia commented 2 years ago

Having read the manual page for mkdir() a bit closer, I think the user mask is automatically subtracted from the mode so we can just set it to S_IRWXU | S_IRWXG | S_IRWXO.