Skip to content

[stable8] Cannot PROPPATCH getlastmodified, getting 403 #15850

Closed

Description

@PVince81

On stable8 (and potentially older versions), doing a PROPPATCH on getlastmodified returns 403.
Not sure why.

On master it will properly set the property.

From what I understand the sync client does such PROPPATCH in case a PUT didn't accept the mtime. (@guruz @ogoffart)

Steps:

  1. Use the following PROPPATCH file:

<?xml version="1.0"?>
<d:propertyupdate xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:set>
    <d:prop>
        <d:getlastmodified>Mon, 19 Jan 2015 19:50:20 GMT</d:getlastmodified>
    </d:prop>
  </d:set>
</d:propertyupdate>
  1. curl -X PROPPATCH -H "Content-Type: text/xml" --data-binary "@proppatchx.txt" http://root:admin@localhost/owncloud/remote.php/webdav/welcome.txt

Expected

200 OK in XML response

Actual

403 OK in XML response

Versions

Observed on v8.0.2 (master is fine with the new Sabre).

Activity

  1. ogoffart commented on Apr 24, 2015

    @ogoffart

    From what I understand the sync client does such PROPPATCH in case a PUT didn't accept the mtime.

    Yes that's correct, but PUT always accept the mtime with recent server.
    The newest version of the client does not even do it anymore and if PUT does not accept it, the mtime will be wrong.

  2. PVince81 commented on Apr 24, 2015

    @PVince81
    ContributorAuthor

    Yes, I also couldn't think of cases where the mtime would not be accepted.

    Anyway, I think still it is legitimate to allow PROPPATCH on getlastmodified, so we might want to see why it doesn't work on OC 8.0

  3. ziotibia81 commented on May 6, 2015

    @ziotibia81

    I confirm this issue on 8.0.3
    (The problem in't only on 403 response, mtime of file don't change at all)

  4. ziotibia81 commented on Jun 19, 2015

    @ziotibia81

    There are a way to make it work on 8.0.4?

  5. PVince81 commented on Jun 19, 2015

    @PVince81
    ContributorAuthor

    I didn't have to look into this sorry... fully booked with upcoming 8.1 release.

    If you feel adventurous you can try debugging the OC code, the location should be here https://github.com/owncloud/core/blob/stable8/lib/private/connector/sabre/node.php#L162

  6. ziotibia81 commented on Jun 19, 2015

    @ziotibia81

    Solved.... The problem is here:
    https://github.com/owncloud/3rdparty/blob/stable8/sabre/dav/lib/Sabre/DAV/Server.php#L104

    Removing this line matime is chaged. Listing file in DAV I can see correct mtime. In web view I still view time of upload.

  7. PVince81 commented on Jun 19, 2015

    @PVince81
    ContributorAuthor

    You need to make sure that it does not write the lastmodified property in the "oc_properties" table. I believe that was the reason for the protected properties.

    If this works correctly, do you mind sending the change as a pull request ?

  8. ziotibia81 commented on Jun 19, 2015

    @ziotibia81

    I think that reason because this property is protected is RFC4918, where getlastmodified is readonly. Many Webdav servers breaks this rule and permit to use getlastmodified to set mtime, so it looks like to be a standard feature.

    It seems to me we understand that L162 of node.php manage {DAV:}lastmodified to change mtime.
    In this case also node.php need to be fixed.

  9. ziotibia81 commented on Jun 19, 2015

    @ziotibia81

    I sent two PR:

    #17051

    owncloud-archive/3rdparty#177
    (there are something wrong in my PR. Only this commit is the patch:
    ziotibia81/3rdparty@94efe7b )

  10. ziotibia81 commented on Jun 19, 2015

    @ziotibia81

    @PVince81 Could you manage commit ziotibia81/3rdparty@94efe7b ? I'm not very skilled and I'm making too much hassle in GitHub.....

  11. MorrisJobke commented on Aug 28, 2015

    @MorrisJobke
    Contributor

    Solution is an upgrade to 8.1 see #17051 (comment)

  12. PVince81 commented on Oct 13, 2015

    @PVince81
    ContributorAuthor

    Looks like there was a misunderstanding. You need to proppatch "{DAV:}lastmodified" and not "{DAV:}getlastmodified". This will work in OC <= 8.0.

    Since 8.1 you need to proppatch "getlastmodified", which is wrong, raised here: #19737

  13. 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

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions