Browse Source

check if user has write access to a given file before updating the filekey

remotes/origin/stable5
Bjoern Schiessle 13 years ago
parent
commit
34f93ac765
  1. 6
      apps/files_encryption/lib/keymanager.php
  2. 2
      lib/ocs.php

6
apps/files_encryption/lib/keymanager.php

@ -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 );

2
lib/ocs.php

@ -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…
Cancel
Save