Skip to content

TextEditor: Checksum not invalidated on file change #23782

Closed

Description

@dragotin

Steps to reproduce

  1. Create a text file with the sync client
  2. Wait until it is synced.
  3. Check that it has a checksum in the database, which was sent from the client.
  4. Edit the file from the built in texteditor, let it save.
  5. See that the checksum of the file has not changed.

Expected behaviour

When a file is changed, the checksum on the server needs to be recalculated. If that can not be done, it needs at least to be invalidated.

Having a wrong checksum for a file is a critical problem as the client will complain about a corrupted file.

Server configuration

Operating system:
Linux
Web server:
apache
Database:
mysql
PHP version:
5.5.14
ownCloud version: (see ownCloud admin page)
9.0.x, master branch, 15833d9
Updated from an older ownCloud or fresh install:

Where did you install ownCloud from:
git
Are you using external storage, if yes which one: local/smb/sftp/...
no external storage
Are you using encryption: yes/no
no encryption
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
no user-backend.

Activity

  1. MorrisJobke commented on Apr 4, 2016

    @MorrisJobke
    Contributor

    sev3 because there is not yet any client out there that uses the checksums.

  2. added this to the milestone on Apr 4, 2016
  3. rullzer commented on Apr 4, 2016

    @rullzer
    Contributor

    mmmm I don't get this. Doesn't the texteditor use dav?

  4. rullzer commented on Apr 4, 2016

    @rullzer
    Contributor

    Ah no it seems it uses internal calls. So when we modify a file we must just reset the checksum to the empty string. @icewind1991 can you help with that?

    I think it only has to be handled in the view.php::file_put_contents function right?

  5. modified the milestones: , on Apr 4, 2016
  6. rullzer commented on Apr 4, 2016

    @rullzer
    Contributor

    Raised to sev2 as this has to be fixed for 9.0.2 from my POV. @cmonteroluque

  7. dragotin commented on Apr 4, 2016

    @dragotin
    ContributorAuthor

    @MorrisJobke ...exept the few desktop clients (version 2.1.1) that some enthusiasts might use ;-). The client uses the checksum to validate the download from the server by comparing the server stored checksum to one that the client calculates after download.

    With this bug, the client will refuse the download of the file once it was saved by the text editor because the checksums do not match. I wonder which other apps use "internal calls" to store data and have the same problem.

    Well, morris, the fix is easy once the users call because of this: Just update the filecache and set all checksums to empty. 😢

  8. MorrisJobke commented on Apr 4, 2016

    @MorrisJobke
    Contributor

    exept the few desktop clients (version 2.1.1) that some enthusiasts might use ;-)

    Oh. Really? I thought it will be present in the next major release 🙈 Sorry

  9. MorrisJobke commented on Apr 4, 2016

    @MorrisJobke
    Contributor

    Raised to sev2 as this has to be fixed for 9.0.2 from my POV. @cmonteroluque

    Yep.

  10. 6 remaining items

  11. rullzer commented on Apr 19, 2016

    @rullzer
    Contributor

    PR 1 of 2 in #24098

  12. PVince81 commented on Apr 19, 2016

    @PVince81
    Contributor

    @rullzer yes, I guess you meant only for fopen in one of the write modes, not read.
    You might also be able to do it at close time, see https://github.com/owncloud/core/blob/v9.0.1/lib/private/files/view.php#L1092 (this code is run after the file was closed).

    It's probably best to clear the checksum in one of the existing database calls instead of adding new ones though (which makes the "close time" approach less interesting)

  13. rullzer commented on Apr 19, 2016

    @rullzer
    Contributor

    Yes I agree. But the current calls don't allow me to easily inject it there.. without doing it all the time. For example on move and copy we don't want to clear the checksum etc.

  14. rullzer commented on Apr 19, 2016

    @rullzer
    Contributor

    PR that fixes both cases in #24098 now

  15. added a commit that references this issue on Apr 20, 2016
    2296552
  16. modified the milestones: , on Apr 20, 2016
  17. rullzer commented on Apr 20, 2016

    @rullzer
    Contributor

    Stable 9 backport in #24129

  18. lock commented on Aug 4, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions