Skip to content

Commit bbc1030

Browse files
icewind1991CarlSchwan
authored andcommitted
fix: only mask the permissions for the users home directory for public shares
fix: only mask the permissions for the users home directory for public shares this ensures that versions/trashbin/etc is still usable Signed-off-by: Robin Appelman <robin@icewind.nl> Signed-off-by: Carl Schwan <carlschwan@kde.org>
1 parent 8ad7ccc commit bbc1030

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

apps/dav/appinfo/v1/publicwebdav.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* SPDX-License-Identifier: AGPL-3.0-only
77
*/
88
use OC\Files\Filesystem;
9-
use OC\Files\Storage\Wrapper\PermissionsMask;
9+
use OC\Files\Storage\Wrapper\DirPermissionsMask;
1010
use OC\Files\View;
1111
use OCA\DAV\Connector\LegacyPublicAuth;
1212
use OCA\DAV\Connector\Sabre\ServerFactory;
@@ -98,7 +98,11 @@ function (\Sabre\DAV\Server $server) use (
9898
// FIXME: should not add storage wrappers outside of preSetup, need to find a better way
9999
$previousLog = Filesystem::logWarningWhenAddingStorageWrapper(false);
100100
Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
101-
return new PermissionsMask(['storage' => $storage, 'mask' => $share->getPermissions() | Constants::PERMISSION_SHARE]);
101+
return new DirPermissionsMask([
102+
'storage' => $storage,
103+
'mask' => $share->getPermissions() | Constants::PERMISSION_SHARE,
104+
'path' => 'files'
105+
]);
102106
});
103107
Filesystem::addStorageWrapper('shareOwner', function ($mountPoint, $storage) use ($share) {
104108
return new PublicOwnerWrapper(['storage' => $storage, 'owner' => $share->getShareOwner()]);

apps/files_versions/lib/Versions/LegacyVersionsBackend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function createVersion(IUser $user, FileInfo $file) {
157157
Storage::scheduleExpire($user->getUID(), $relativePath);
158158

159159
// store a new version of a file
160-
$res = $userView->copy('files/' . $relativePath, 'files_versions/' . $relativePath . '.v' . $file->getMtime());
160+
$userView->copy('files/' . $relativePath, 'files_versions/' . $relativePath . '.v' . $file->getMtime());
161161
// ensure the file is scanned
162162
$userView->getFileInfo('files_versions/' . $relativePath . '.v' . $file->getMtime());
163163
}

0 commit comments

Comments
 (0)