Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
9661a63a
Commit
9661a63a
authored
12 years ago
by
Michael Gapczynski
Browse files
Options
Downloads
Patches
Plain Diff
Ensure permissions can't be escalated during a reshare
parent
028c79fc
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/public/share.php
+12
-7
12 additions, 7 deletions
lib/public/share.php
with
12 additions
and
7 deletions
lib/public/share.php
+
12
−
7
View file @
9661a63a
...
...
@@ -662,13 +662,18 @@ class Share {
// Check if this is a reshare
// TODO This query has pretty bad performance if there are large collections, figure out a way to make the collection searching more efficient
if
(
$checkReshare
=
self
::
getItemSharedWith
(
$itemType
,
$itemSource
,
self
::
FORMAT_NONE
,
null
,
true
))
{
if
(
$checkReshare
[
'permissions'
]
&
self
::
PERMISSION_SHARE
)
{
// TODO Check that other permissions aren't escalated
if
((
int
)
$checkReshare
[
'permissions'
]
&
self
::
PERMISSION_SHARE
)
{
if
(
~
(
int
)
$checkReshare
[
'permissions'
]
&
$permissions
)
{
$message
=
'Sharing '
.
$itemSource
.
' failed, because the permissions exceed permissions granted to '
.
$uidOwner
;
\OC_Log
::
write
(
'OCP\Share'
,
$message
,
\OC_Log
::
ERROR
);
throw
new
\Exception
(
$message
);
}
else
{
// TODO Don't check if inside folder
$parent
=
$checkReshare
[
'id'
];
$itemSource
=
$checkReshare
[
'item_source'
];
$fileSource
=
$checkReshare
[
'file_source'
];
$filePath
=
$checkReshare
[
'file_target'
];
}
}
else
{
$message
=
'Sharing '
.
$itemSource
.
' failed, because resharing is not allowed'
;
\OC_Log
::
write
(
'OCP\Share'
,
$message
,
\OC_Log
::
ERROR
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment