Skip to content

proppatch lastmodified instead of getlastmodified #19737

Closed

Description

@PVince81

In OC <= 8.0, to update the mtime of a file one had to do a PROPATCH of the {DAV:}lastmodified property. The desktop client used to do it in its legacy propagator.

Since OC 8.1 and the Sabre upgrade, the property was mistakenly shifted to be "getlastmodified" instead of "lastmodified". So now one would need to PROPPATCH the other property.

This is wrong. We need to bring back "lastmodified" to keep backwardc compatible.

Additionally, the DAV external storage client also uses this property when doing a "touch()" operation.

Activity

  1. PVince81 commented on Oct 13, 2015

    @PVince81
    ContributorAuthor

    Steps to reproduce:

    1. Create a file "test1.txt" in the web UI
    2. Save this file locally as "proppatch.txt":
    <?xml version="1.0"?>
    <d:propertyupdate xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
      <d:set>
        <d:prop>
                    <d:lastmodified>Fri, 13 Feb 2015 00:00:00 GMT</d:lastmodified>
        </d:prop>
      </d:set>
    </d:propertyupdate>
    1. Run curl: curl -X PROPPATCH -H "Content-Type: text/xml" --data-binary "@proppatch.txt" http://root:admin@localhost/owncloud/remote.php/webdav/test1.txt | xmllint --format -
    2. Refresh the web UI and check the mtime of "test1.txt"

    Expected result

    Mtime has changed.
    Also using "getlastmodified" must return 403.

    Actual result

    Mtime hasn't changed.
    In OC >= 8.1 one needs to use "getlastmodified", which is wrong.

  2. PVince81 commented on Oct 13, 2015

    @PVince81
    ContributorAuthor

    CC @rperezb in case this affects mobile clients (are they using PROPATCH to change mtimes?)
    Also would be good to have a (smashbox?) test case for this.

  3. PVince81 commented on Oct 13, 2015

    @PVince81
    ContributorAuthor

    I believe that until now no clients have been using it, else it would have caused issues starting with 8.1. Also in general from what I read this property is usually read-only, and OC is the only one that allows changing is, see http://stackoverflow.com/a/17979769

    So, not critical but needs to be fixed eventually.
    @cmonteroluque @DeepDiver1975 @karlitschek I suggest 8.2.1 for now

  4. added this to the milestone on Oct 13, 2015
  5. PVince81 commented on Oct 13, 2015

    @PVince81
    ContributorAuthor

    it could affect federated shares though. Might explain #15594

  6. PVince81 commented on Oct 13, 2015

    @PVince81
    ContributorAuthor

    PR here #19738

  7. rperezb commented on Oct 13, 2015

    @rperezb

    @PVince81 we are not using proppatch on the mobile apps

  8. modified the milestones: , on Oct 14, 2015
  9. guruz commented on Oct 16, 2015

    @guruz
    Contributor

    This is wrong. We need to bring back "lastmodified" to keep backwardc compatible.

    Just to state this again: We need to kill the legacy propagator :-|
    Please have us require Qt >= 5.4 on all platforms.

  10. PVince81 commented on Oct 16, 2015

    @PVince81
    ContributorAuthor

    @guruz for the server it doesn't matter if the client doesn't use it any more.
    We still need "lastmodified" PROPPATCH for federated shares (they use it to "touch" remote files)

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