Skip to content

Commit

Permalink
fixes potential issues in file-crypto destination handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ricwein committed Aug 29, 2018
1 parent fc24650 commit d6ec5cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Symmetric/Crypto.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ protected function prepareDestination(Storage $source, $destination = null): Fil
throw new UnsupportedException(sprintf('unable to use file-base cryptography for the given destination-storage \'%s\'', get_class($destination)), 400);
} elseif ($destination->isFile() && !$destination->isWriteable()) {
throw new AccessDeniedException('unable to write to destination', 500);
} elseif (!$destination->isFile() && !$destination->touch(true)) {
throw new AccessDeniedException('unable to create destination file', 500);
}

return $destination;
Expand Down

0 comments on commit d6ec5cd

Please sign in to comment.