Navigation Menu

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

Use parent wrapper to properly handle moves on the same source/target storage #26980

Merged
merged 1 commit into from May 18, 2021

Conversation

juliushaertl
Copy link
Member

@juliushaertl juliushaertl commented May 14, 2021

Steps to reproduce:

  • Share a folder from a groupfolder to another user
  • Try to upload a file to the shared folder as the user without access to the original groupfolder

Moving the part file to the final one failed after #25568 as the general wrapper logic to use a rename instead of a moveFromStorage from

if ($sourceStorage === $this) {
return $this->rename($sourceInternalPath, $targetInternalPath);
}
return $this->getWrapperStorage()->moveFromStorage($sourceStorage, $sourceInternalPath, $targetInternalPath);
was not called anymore.

Fixes nextcloud/groupfolders#1453
Fixes nextcloud/groupfolders#1445

… storage

Signed-off-by: Julius Härtl <jus@bitgrid.net>
@juliushaertl juliushaertl added bug 3. to review Waiting for reviews labels May 14, 2021
@juliushaertl juliushaertl added this to the Nextcloud 22 milestone May 14, 2021
@juliushaertl
Copy link
Member Author

/backport to stable21

@juliushaertl
Copy link
Member Author

/backport to stable20

Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

@mowtee
Copy link

mowtee commented May 17, 2021

Tested it and fixed our issue. Thank you so much!

@MorrisJobke MorrisJobke requested a review from rullzer May 18, 2021 07:33
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@rullzer rullzer merged commit 9e1c367 into master May 18, 2021
@rullzer rullzer deleted the bugfix/noid/partfile-move-storage branch May 18, 2021 08:20
@jknockaert
Copy link
Contributor

Would it be possible to add a test to avoid this type of issues?

@Ornanovitch
Copy link

will this be included in 21.0.2 or shall we patch manually until a later version?

@MorrisJobke
Copy link
Member

will this be included in 21.0.2 or shall we patch manually until a later version?

21.0.2 will definitely not have it, because it will be released on Thursday and the merge window for that version is already closed. Maybe we backport this to 21.0.3.

@juliushaertl Opinions on the backport?

@MorrisJobke
Copy link
Member

Ah .. it already is scheduled for a backport

@MorrisJobke
Copy link
Member

/backport to stable21

@MorrisJobke
Copy link
Member

/backport to stable20

@backportbot-nextcloud
Copy link

The backport to stable21 failed. Please do this backport manually.

@backportbot-nextcloud
Copy link

The backport to stable20 failed. Please do this backport manually.

@backportbot-nextcloud
Copy link

The backport to stable21 failed. Please do this backport manually.

@backportbot-nextcloud
Copy link

The backport to stable20 failed. Please do this backport manually.

@juliushaertl
Copy link
Member Author

stable21 #27015
stable20 #27016

@nextclouduser74
Copy link

Am not a developer just admin and I tried this fix, and it seems to work, BUT:
You put something in the shared subfolder of groupfolders <-- this didn't work before the fix it works now,
when you try to move it to your Home-Folder you get again this here:

Error core unable to rename, source directory is not writable :

The failure is the same. Path is /mnt/data/shared_subfolder instead of /mnt/data/__groupfolders/number/shared_subfolder.

Copying/Moving INTO the share works now, moving something out of the share doesn't work. The only way is to copy the file/folder to the destination and then delete it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
7 participants