check if user has write access to a given file before updating the filekey
This commit is contained in:
parent
3ec6dc56c9
commit
34f93ac765
2 changed files with 7 additions and 1 deletions
|
@ -167,6 +167,12 @@ class Keymanager {
|
|||
$targetpath_parts=explode( '/',$targetpath );
|
||||
|
||||
$user = $targetpath_parts[1];
|
||||
|
||||
$rootview = new \OC_FilesystemView( '/');
|
||||
if (!$rootview->is_writable($targetpath)) {
|
||||
\OC_Log::write( 'Encryption library', "File Key not updated because you don't have write access for the corresponding file" , \OC_Log::ERROR );
|
||||
return false;
|
||||
}
|
||||
|
||||
$targetpath = str_replace( '/'.$user.'/files/', '', $targetpath );
|
||||
|
||||
|
|
|
@ -767,7 +767,7 @@ class OC_OCS {
|
|||
}
|
||||
|
||||
/**
|
||||
* set the encryption keyn of a file
|
||||
* set the encryption key of a file
|
||||
* @param string $format
|
||||
* @param string $file
|
||||
* @param string $key
|
||||
|
|
Loading…
Reference in a new issue