Skip to content

ownCloud external storage mount doesn't work with encryption #5952

Closed

Description

@PVince81

Steps

  1. Mount a WebDAV storage (another ownCloud)
  2. Enable encryption
  3. Upload file
  4. Download file

Expected result

Downloaded file is not encrypted.

Actual result

Downloaded file is still encrypted

CC @schiesbn FYI
I suspect it could be another fseek() issue.

Activity

  1. schiessle commented on Nov 19, 2013

    @schiessle
    Contributor

    yes, sounds like similar problems we had with samba. The strange think here is that webdav worked in the past, I always used the webdav back-end to test encryption and I doubt that the fseek() implementation changed lately.

  2. PVince81 commented on Nov 20, 2013

    @PVince81
    ContributorAuthor

    I've tried on the latest master and it might be something else.
    When downloading a file the file is empty.
    Editing text files directly with the text editor work.

    Here is the error log:

        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP Warning:  fopen(crypt:///root/files/webdav/test/test.txt): failed to open stream: "OCA\\Encryption\\Stream::stream_open" call failed in /home/vincent/workspace/owncloud/apps/files_encryption/lib/proxy.php on line 276, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP Stack trace:, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP   1. {main}() /home/vincent/workspace/owncloud/index.php:0, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP   2. OC::handleRequest() /home/vincent/workspace/owncloud/index.php:30, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP   3. OC_Router->match() /home/vincent/workspace/owncloud/lib/base.php:666, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP   4. call_user_func() /home/vincent/workspace/owncloud/lib/private/router.php:127, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP   5. OC::loadAppScriptFile() /home/vincent/workspace/owncloud/lib/private/router.php:0, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP   6. require_once() /home/vincent/workspace/owncloud/lib/base.php:742, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP   7. OC_Files::get() /home/vincent/workspace/owncloud/apps/files/ajax/download.php:42, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP   8. OC\\Files\\Filesystem::readfile() /home/vincent/workspace/owncloud/lib/private/files.php:166, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP   9. OC\\Files\\View->readfile() /home/vincent/workspace/owncloud/lib/private/files/filesystem.php:582, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP  10. OC\\Files\\View->fopen() /home/vincent/workspace/owncloud/lib/private/files/view.php:202, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP  11. OC\\Files\\View->basicOperation() /home/vincent/workspace/owncloud/lib/private/files/view.php:580, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP  12. OC_FileProxy::runPostProxies() /home/vincent/workspace/owncloud/lib/private/files/view.php:682, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP  13. OCA\\Encryption\\Proxy->postFopen() /home/vincent/workspace/owncloud/lib/private/fileproxy.php:107, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
        [Wed Nov 20 18:10:23 2013] [error] [client 127.0.0.1] PHP  14. fopen() /home/vincent/workspace/owncloud/apps/files_encryption/lib/proxy.php:276, referer: http://localhost/vincent/index.php/apps/files?dir=/webdav/test
    
  3. PVince81 commented on Nov 20, 2013

    @PVince81
    ContributorAuthor

    Note that I have OC 5.0.13 as WebDAV backend, I haven't tried with an OC 6 backend.

  4. Pazu commented on Nov 21, 2013

    @Pazu

    Reminds me also of owncloud-archive/apps#1344.

  5. PVince81 commented on Feb 4, 2014

    @PVince81
    ContributorAuthor

    There is an additional issue when using two ownCloud: if backend OC is encrypted and not frontend OC, when uploading a file through frontend OC with WebDAV, the part file will not be treated correctly by the backend OC.
    The key file resolution will cut off the .part from the frontend's part file, which prevents the encryption code to use the key.

  6. modified the milestones: , on May 7, 2014
  7. PVince81 commented on Jun 16, 2014

    @PVince81
    ContributorAuthor

    We might need to eventually find a fix for this to make server to server sharing work properly with encryption.

    @karlitschek @craigpg FYI

  8. schiessle commented on Jun 16, 2014

    @schiessle
    Contributor

    didn't had a look at this issue in detail. But I tested server-to-server sharing with encryption and I could read/write files just fine

  9. PVince81 commented on Jun 17, 2014

    @PVince81
    ContributorAuthor

    The issue is when the remote server is encrypted.
    Try uploading a file there using the sync client: the part file cannot be renamed properly on the remote server.

  10. modified the milestones: , on Jun 24, 2014
  11. PVince81 commented on Aug 19, 2014

    @PVince81
    ContributorAuthor

    One idea would be to disable encryption for the "ownCloud" external storage backend but keep it for the "WebDAV" external storage backend which is now more intended for "real" WebDAV servers like lighttpd.

    Note that for server to server sharing we already disable encryption of the remote files.

    Disabling encryption would prevent the issue of having files encrypted multiple times in cascade.

  12. modified the milestones: , on Sep 2, 2014
  13. 27 remaining items

  14. DeepDiver1975 commented on Jan 7, 2015

    @DeepDiver1975
    Contributor

    But in order to solve this issue for OC8 we could add a second condition?

    @schiesbn can you come up with a PR - THX

  15. schiessle commented on Jan 7, 2015

    @schiessle
    Contributor

    But in order to solve this issue for OC8 we could add a second condition?

    yes, this would be the simple and quick solution. I will prepare a PR later today

  16. DeepDiver1975 commented on Jan 7, 2015

    @DeepDiver1975
    Contributor

    yes, this would be the simple and quick solution. I will prepare a PR later today

    great - thx

  17. PVince81 commented on Jan 7, 2015

    @PVince81
    ContributorAuthor

    Fix is here: #13156

    CC @ZacharyDuBois FYI

  18. PVince81 commented on Jan 7, 2015

    @PVince81
    ContributorAuthor

    There's a better fix here #13160
    Please ignore the previous one.

    Note that it will still encrypt files on the target OC for now (see comment here: #13156 (comment))

  19. changed the title [-]WebDAV mount doesn't work with encryption[/-] [+]ownCloud external storage mount doesn't work with encryption[/+] on Jan 7, 2015
  20. ZacharyDuBois commented on Jan 8, 2015

    @ZacharyDuBois

    I will give it a test the next time I get a chance :)

  21. modified the milestones: , on Jan 14, 2015
  22. MorrisJobke commented on Jan 16, 2015

    @MorrisJobke
    Contributor

    fixed with #13160

  23. carlaschroder commented on Jan 28, 2015

    @carlaschroder

    removing release note tag cos 13160

  24. locked as resolved and limited conversation to collaborators on Aug 13, 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