From 7e9077d30eebc1c918d1f08f9bb784c820d444e9 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 10 Feb 2018 11:28:52 +0100 Subject: [PATCH] Permissions fix for doc folders --- Logic/Support/Document.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Logic/Support/Document.cs b/Logic/Support/Document.cs index 0d180cf3..0eb473cb 100644 --- a/Logic/Support/Document.cs +++ b/Logic/Support/Document.cs @@ -98,8 +98,16 @@ namespace Swarmops.Logic.Support { Syscall.chmod(wholePath, FilePermissions.S_IRWXU | FilePermissions.S_IRWXO | FilePermissions.S_IRWXG); - } + // Just to be sure, also set the parent (month) and grandparent (year) permissions + // to rwxr-xr-x (backend must be able to see traverse to here) + + Syscall.chmod(wholePath.Substring(wholePath.Length - 3), // strip the last "/dd" from the path, leaving "/storageroot/yyyy/mm" + FilePermissions.S_IRWXU | FilePermissions.S_IRGRP | FilePermissions.S_IXGRP | FilePermissions.S_IROTH | FilePermissions.S_IXOTH); + + Syscall.chmod(wholePath.Substring(wholePath.Length - 6), // strip the "/mm/dd" from the path, leaving "/storageroot/yyyy" + FilePermissions.S_IRWXU | FilePermissions.S_IRGRP | FilePermissions.S_IXGRP | FilePermissions.S_IROTH | FilePermissions.S_IXOTH); + } } return wholePath + Path.DirectorySeparatorChar;