Properly check share permissions

isCreatable only works on folders
isUpdatable if the file is not there but it is a part file also has to
be checked on the folder

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-09-06 17:07:49 +02:00 committed by Joas Schilling
parent 43f73ad808
commit b66b2de6ff
No known key found for this signature in database
GPG key ID: 7076EA9751AACDDA

View file

@ -258,11 +258,17 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
case 'xb':
case 'a':
case 'ab':
$creatable = $this->isCreatable($path);
$creatable = $this->isCreatable(dirname($path));
$updatable = $this->isUpdatable($path);
// if neither permissions given, no need to continue
if (!$creatable && !$updatable) {
return false;
if (pathinfo($path, PATHINFO_EXTENSION) === 'part') {
$updatable = $this->isUpdatable(dirname($path));
}
if (!$updatable) {
return false;
}
}
$exists = $this->file_exists($path);