Skip to content

More consistent permissions for mount points - #20685

Closed
PVince81 wants to merge 4 commits into
masterfrom
files-consistentpermsformountpoint
Closed

PVince81 wants to merge 4 commits into
masterfrom
files-consistentpermsformountpoint

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

Whenever a mount point is retrieved through getFileInfo or a listing of
a directory, the permissions returned must be the same.

@icewind1991 is that what you meant in #20426 (comment) ?

Note: this only makes the permissions consistent.

CC @rullzer @MorrisJobke

TODO:

  • unit tests

Comment thread lib/private/files/fileinfo.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not 100% sure if this will mess with being able to delete files inside the folder.

I think we handle that on storage layer (calculating delete/rename permissions taking the parent folder into account) but I'm not sure

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On master with the web UI it seems to work fine, I'm able to make changes in the external storage folder.

The permissions on the entries themselves seem to allow that.

@PVince81 PVince81 added this to the 9.1-current milestone Mar 21, 2016
@PVince81
PVince81 force-pushed the files-consistentpermsformountpoint branch from b1bf955 to 38e25a6 Compare March 21, 2016 17:05
@PVince81

Copy link
Copy Markdown
Contributor Author

Rebased.

Unit tests still pending...

@PVince81 PVince81 self-assigned this Mar 21, 2016
@PVince81
PVince81 force-pushed the files-consistentpermsformountpoint branch from 38e25a6 to 697aef8 Compare March 22, 2016 12:09
@PVince81

Copy link
Copy Markdown
Contributor Author

Added/fixed unit tests

@PVince81
PVince81 force-pushed the files-consistentpermsformountpoint branch from 697aef8 to 0ce5cc8 Compare March 22, 2016 12:41
@PVince81

Copy link
Copy Markdown
Contributor Author

Rebased onto non-broken commit from master.

Added integration tests.

Please review!

Comment thread lib/private/files/fileinfo.php Outdated
public function getPermissions() {
$perms = $this->data['permissions'];
// if this is the mount point itself
if (empty($this->internalPath)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

don't use empty on strings ('0')

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ouch... old code from before I learnt the lesson. Learnt again...

@icewind1991

Copy link
Copy Markdown
Contributor

👍 otherwise

@PVince81
PVince81 force-pushed the files-consistentpermsformountpoint branch from 2f2be3c to 979f407 Compare March 22, 2016 15:03
@rullzer

rullzer commented Mar 22, 2016

Copy link
Copy Markdown
Contributor

👍

@MorrisJobke

Copy link
Copy Markdown
Contributor

@PVince81 Integration tests fail :(

@PVince81

Copy link
Copy Markdown
Contributor Author

Hmmm... I suspect that some logic changed. From the other unit tests it looks like we only added "DELETE" permissions on received shares. Now we add "UPDATE" + "DELETE" to match whatever is returned by the main PROPFIND.

@rullzer do you see any potential issue with this regarding reshare permissions ? Or can I safely adjust the integration test ?

@PVince81

Copy link
Copy Markdown
Contributor Author
  • TODO: double check permission consistency for incoming file share (not folder)
  • TODO: fix integration test

@PVince81

Copy link
Copy Markdown
Contributor Author

Trouble ahead: for read-only file shares, the permissions are usually "SRDNVW" when viewed from the parent which makes it possible to rename and delete (unshare from self) the shared file. The direct permissions are "SRD", which account to the fact that the file is read-only.

However on this PR this is normalized to "SRDNVW", always. So the information that this file is read-only is lost somehow... I haven't tested how the sync client reacts to this.

The text editor however seems to have its own read-only check and doesn't rely on what the file list says. The weird part of this is that one might need to check data-share-permissions instead of data-permissions to get the file's true permissions.

This is all because we need the update + delete permissions to be able to move a received share file.

@rullzer

rullzer commented Mar 22, 2016

Copy link
Copy Markdown
Contributor

Ai... I did not think of that.

So regarding resharing. Well we depend on proper permissions returned by te Node API to check that. So if that now startes returning UPDATE permissions for RO shares then we will allow that. So we need to double check this..

@rullzer

rullzer commented Mar 22, 2016

Copy link
Copy Markdown
Contributor

Regarding the webdav permissions. I'm now also less certain. As this patch will make it basically impossible for RO file shares to be marked as RO on the clients.

@PVince81 lets discuss this tomorrow... as this is the permissions mess all over again and we need to think how to properly solve it... (maybe some brainstorming with a whiteboard next week?)

@PVince81

Copy link
Copy Markdown
Contributor Author

@rullzer I also think this isn't that critical for 9.0.1 (unless @guruz @ckamm say otherwise).
So if we find a cleaner solution for 9.1, for example using your newly introduced Webdav property for share permissions, we might get a better chance at making this right.

@PVince81
PVince81 force-pushed the files-consistentpermsformountpoint branch from 979f407 to ab69fc1 Compare June 10, 2016 14:36
@PVince81

Copy link
Copy Markdown
Contributor Author

Rebased.

@icewind1991

Copy link
Copy Markdown
Contributor

👍 looks good

@PVince81

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I think this needs careful retesting, also with federated shares, to make sure it doesn't introduce regressions.

@PVince81

Copy link
Copy Markdown
Contributor Author

Also, potential issue: #20685 (comment)

Not sure if recent changes to permission handling would help here

@ChristophWurst

Copy link
Copy Markdown
Contributor

TODO: double check permission consistency for incoming file share (not folder)
TODO: fix integration test

@PVince81 is that still to-do?

@DeepDiver1975

Copy link
Copy Markdown
Contributor

@PVince81 9.2 ?

@PVince81 PVince81 modified the milestones: 9.2, 9.1 Jul 11, 2016
@PVince81 PVince81 modified the milestones: 10.0.1, 10.0 Apr 6, 2017
@PVince81 PVince81 modified the milestones: 10.0.2, 10.0.1 May 19, 2017
@PVince81 PVince81 modified the milestones: 10.0.2, 10.0.3 May 26, 2017
@PVince81 PVince81 modified the milestones: backlog, development Jul 10, 2017
@PVince81 PVince81 closed this Jul 19, 2017
@PVince81
PVince81 deleted the files-consistentpermsformountpoint branch July 19, 2017 10:06
@lock

lock Bot commented Aug 3, 2019

Copy link
Copy Markdown

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock Bot locked as resolved and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants