Skip to content

Ext storage + shares + encryption, cannot download files as recipient #15645

Closed

Description

@PVince81

Steps to reproduce:

  1. Enable encryption
  2. Enable external storage
  3. Mount SFTP external storage "/sftp" (I tested with global storage, might happen with local as well)
  4. Assign the storage to the admin user (mine is "root")
  5. Create two users "user1" and "user2"
  6. Share "sftp" with "user1"
  7. Create a subdir "sftp/sub"
  8. Share "sftp/sub" with "user2"
  9. Upload a pic "test1.jpg" into "sftp"
  10. Upload a pic "test2.jpg into "sftp/sub"
  11. Try downloading "test1.jpg" as "user1"
  12. Try downloading "test2.jpg" as "user2"

Expected result

Files can be downloaded

Actual result

Cannot download

Logs

{"reqId":"4aa24a8cd0ac04d65a386fb9a662ecd1","remoteAddr":"127.0.0.1","app":"index","message":"Exception: {\"Message\":\"Encryption key not found for \\\"\\\/user2\\\/files\\\/sub\\\/P1050922.JPG\\\" during attempted read via stream\",\"Code\":0,\"Trace\":\"#0 [internal function]: OCA\\\\Files_Encryption\\\\Stream->stream_read(8192)\\n#1 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(283): fread(Resource id #475, 8192)\\n#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/filesystem.php(606): OC\\\\Files\\\\View->readfile('\\\/sub\\\/P1050922.J...')\\n#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files.php(155): OC\\\\Files\\\\Filesystem::readfile('\\\/sub\\\/P1050922.J...')\\n#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files\\\/ajax\\\/download.php(37): OC_Files::get('\\\/sub', Array, false)\\n#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/route.php(135) : runtime-created function(1): require_once('\\\/srv\\\/www\\\/htdocs...')\\n#6 [internal function]: __lambda_func(Array)\\n#7 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(250): call_user_func('\\\\x00lambda_3', Array)\\n#8 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/base.php(782): OC\\\\Route\\\\Router->match('\\\/apps\\\/files\\\/aja...')\\n#9 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/index.php(36): OC::handleRequest()\\n#10 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_encryption\\\/lib\\\/stream.php\",\"Line\":281}","level":4,"time":"2015-04-15T14:45:45+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/ajax\/download.php?dir=%2Fsub&files=P1050922.JPG"}
{"reqId":"0c21047f2233303d24a306238708e70a","remoteAddr":"127.0.0.1","app":"index","message":"Exception: {\"Message\":\"Encryption key not found for \\\"\\\/user2\\\/files\\\/sub\\\/P1050922.JPG\\\" during attempted read via stream\",\"Code\":0,\"Trace\":\"#0 [internal function]: OCA\\\\Files_Encryption\\\\Stream->stream_read(8192)\\n#1 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/view.php(283): fread(Resource id #475, 8192)\\n#2 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files\\\/filesystem.php(606): OC\\\\Files\\\\View->readfile('\\\/sub\\\/P1050922.J...')\\n#3 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/files.php(155): OC\\\\Files\\\\Filesystem::readfile('\\\/sub\\\/P1050922.J...')\\n#4 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files\\\/ajax\\\/download.php(37): OC_Files::get('\\\/sub', Array, false)\\n#5 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/route.php(135) : runtime-created function(1): require_once('\\\/srv\\\/www\\\/htdocs...')\\n#6 [internal function]: __lambda_func(Array)\\n#7 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(250): call_user_func('\\\\x00lambda_3', Array)\\n#8 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/lib\\\/base.php(782): OC\\\\Route\\\\Router->match('\\\/apps\\\/files\\\/aja...')\\n#9 \\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/index.php(36): OC::handleRequest()\\n#10 {main}\",\"File\":\"\\\/srv\\\/www\\\/htdocs\\\/owncloud\\\/apps\\\/files_encryption\\\/lib\\\/stream.php\",\"Line\":281}","level":4,"time":"2015-04-15T14:45:46+00:00","method":"GET","url":"\/owncloud\/index.php\/apps\/files\/ajax\/download.php?dir=%2Fsub&files=P1050922.JPG"}

Versions

Observed on stable8 (9dac69b) and also on the enc2_migration branch (#15445).

@schiesbn @th3fallen @DeepDiver1975

Activity

  1. added this to the milestone on Apr 15, 2015
  2. schiessle commented on Apr 22, 2015

    @schiessle
    Contributor

    fixed on master

  3. locked as resolved and limited conversation to collaborators on Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions