Permissions fix: folder +x, file -x

This commit is contained in:
Rick Falkvinge
2017-10-20 17:40:54 +02:00
parent 08cf7b8b0c
commit 34eb020a86
2 changed files with 19 additions and 10 deletions
+6 -2
View File
@@ -280,8 +280,10 @@ namespace Swarmops.Frontend.Socket
"(BackendConvertedFile) " + pageCounter.ToString(CultureInfo.InvariantCulture),
fileLength, guid, null, person);
// Set to readonly, lock out changes, permit all read
Syscall.chmod(Document.StorageRoot + lastPageFileName,
FilePermissions.S_IRWXU | FilePermissions.S_IRGRP | FilePermissions.S_IROTH);
FilePermissions.S_IRUSR | FilePermissions.S_IRGRP | FilePermissions.S_IROTH);
// Prepare to save the next file
lastPageFileName = testPageFileName;
@@ -311,8 +313,10 @@ namespace Swarmops.Frontend.Socket
"(BackendConvertedFile) " + pageCounter.ToString(CultureInfo.InvariantCulture),
fileLengthLastPage, guid, null, person);
// Set to readonly, lock out changes, permit all read
Syscall.chmod(Document.StorageRoot + lastPageFileName,
FilePermissions.S_IRWXU | FilePermissions.S_IRGRP | FilePermissions.S_IROTH);
FilePermissions.S_IRUSR | FilePermissions.S_IRGRP | FilePermissions.S_IROTH);
// Finally, ask the backend to do the high-res conversions, but now we have the basic, fast ones
+13 -8
View File
@@ -220,12 +220,13 @@ namespace Swarmops.Frontend.Automation
{
Directory.CreateDirectory(StorageRoot + fileFolder);
// Set folder permissions to rwxr--r-- if live environment
// Set folder permissions to rwxr-xr-x if live environment
if (!WeAreInDebugEnvironment)
{
Syscall.chmod(StorageRoot + fileFolder,
FilePermissions.S_IRWXU | FilePermissions.S_IRGRP | FilePermissions.S_IROTH);
FilePermissions.S_IRWXU | FilePermissions.S_IRGRP | FilePermissions.S_IROTH |
FilePermissions.S_IXGRP | FilePermissions.S_IXOTH);
}
}
@@ -255,8 +256,10 @@ namespace Swarmops.Frontend.Automation
if (!WeAreInDebugEnvironment)
{
// Set to readonly, lock out changes, permit all read
Syscall.chmod(StorageRoot + relativeFileName,
FilePermissions.S_IRWXU | FilePermissions.S_IRGRP | FilePermissions.S_IROTH);
FilePermissions.S_IRUSR | FilePermissions.S_IRGRP | FilePermissions.S_IROTH);
}
@@ -359,11 +362,13 @@ namespace Swarmops.Frontend.Automation
file.FileName + (pageCounter + 1).ToString(CultureInfo.InvariantCulture),
fileLength, guid, null, authData.CurrentUser);
if (!WeAreInDebugEnvironment)
{
Syscall.chmod(Document.StorageRoot + pageFileName,
FilePermissions.S_IRWXU | FilePermissions.S_IRGRP | FilePermissions.S_IROTH);
}
if (!WeAreInDebugEnvironment)
{
// Set to readonly, lock out changes, permit all read
Syscall.chmod(Document.StorageRoot + pageFileName,
FilePermissions.S_IRUSR | FilePermissions.S_IRGRP | FilePermissions.S_IROTH);
}
}