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

fix permissions of mountpoints #4623

Merged
merged 1 commit into from
May 2, 2017
Merged

Conversation

icewind1991
Copy link
Member

Properly prevent people from moving/renaming mountpoints

Signed-off-by: Robin Appelman <robin@icewind.nl>
@icewind1991 icewind1991 added the 3. to review Waiting for reviews label May 1, 2017
@icewind1991 icewind1991 added this to the Nextcloud 12.0 milestone May 1, 2017
@mention-bot
Copy link

@icewind1991, thanks for your PR! By analyzing the history of the files in this pull request, we identified @LukasReschke, @nickvergessen and @tanghus to be potential reviewers.

@LukasReschke
Copy link
Member

Does this fix nextcloud/groupfolders#7? Any more information would be appreciated. Thanks.

if ($mount instanceof MoveableMount) {
$data['permissions'] = $data['permissions'] | \OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE;
} else {
$data['permissions'] = $data['permissions'] & (\OCP\Constants::PERMISSION_ALL - (\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE));
Copy link
Member

Choose a reason for hiding this comment

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

Please do proper bitwise stuff.

So

$data['permissions'] & ~(\OCP\Constants::PERMISSION_UPDATE | \OCP\Constants::PERMISSION_DELETE);

Copy link
Member Author

Choose a reason for hiding this comment

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

This was copied from getFolderContents I can change both

Copy link
Member

Choose a reason for hiding this comment

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

Ah well leave as is for now then.

@icewind1991
Copy link
Member Author

Does this fix nextcloud/groupfolders#7? Any more information would be appreciated. Thanks.

Yes, but it still shows rename/move as option in the ui, will have to look into that issue seperate

@MorrisJobke MorrisJobke merged commit aa39f9b into master May 2, 2017
@MorrisJobke MorrisJobke deleted the fileinfo-mount-permissions branch May 2, 2017 20:28
@MorrisJobke
Copy link
Member

Reverted in #4684

@icewind1991 Please have a loot at this.

@MorrisJobke
Copy link
Member

@LukasReschke FYI regarding release stuff.

@LukasReschke
Copy link
Member

:-/

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants