Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable28] fix: improve checks for moving shares/storages into other mounts #50160

Draft
wants to merge 6 commits into
base: stable28
Choose a base branch
from

Conversation

backportbot[bot]
Copy link

@backportbot backportbot bot commented Jan 13, 2025

Backport of #49552

Warning, This backport's changes differ from the original and might be incomplete ⚠️

Todo

  • Review and resolve any conflicts
  • Remove all the empty commits
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@hamza221
Copy link
Contributor

/compile /

lib/private/Files/View.php Fixed Show fixed Hide fixed
lib/private/Files/View.php Fixed Show fixed Hide fixed
lib/private/Files/View.php Fixed Show fixed Hide fixed
lib/private/Files/View.php Fixed Show fixed Hide fixed
lib/private/Files/View.php Fixed Show fixed Hide fixed
lib/private/Files/View.php Fixed Show fixed Hide fixed
lib/private/Files/View.php Fixed Show fixed Hide fixed
lib/private/Files/View.php Fixed Show fixed Hide fixed
lib/private/Files/View.php Fixed Show fixed Hide fixed
lib/private/Files/View.php Fixed Show fixed Hide fixed
Signed-off-by: nextcloud-command <[email protected]>
@hamza221 hamza221 force-pushed the backport/49552/stable28 branch from 63827ed to a19a04a Compare January 24, 2025 12:44
@hamza221
Copy link
Contributor

@icewind1991 I tried to fix the PSALM warnings, can you please double check If I did something wrong

@@ -806,13 +827,19 @@
}
// moving a file/folder within the same mount point
} elseif ($storage1 === $storage2) {
if (count($movedMounts) > 0) {
$this->validateMountMove($movedMounts, $mount1, $mount2, !$this->targetIsNotShared($targetUser, $absolutePath2));

Check failure

Code scanning / Psalm

InvalidArgument Error

Argument 1 of OC\Files\View::targetIsNotShared expects OCP\Files\Storage\IStorage, but null|string provided
if ($storage1) {
$result = $storage1->rename($internalPath1, $internalPath2);
} else {
$result = false;
}
// moving a file/folder between storages (from $storage1 to $storage2)
} else {
if (count($movedMounts) > 0) {
$this->validateMountMove($movedMounts, $mount1, $mount2, !$this->targetIsNotShared($targetUser, $absolutePath2));

Check failure

Code scanning / Psalm

InvalidArgument Error

Argument 1 of OC\Files\View::targetIsNotShared expects OCP\Files\Storage\IStorage, but null|string provided
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants