Skip to content

Creation of share does not change permissions or eTags #34666

Closed

Description

@felix-schwarz

Steps to reproduce

  1. Take a PROPFIND of /Documents/ from [email protected] before sharing /Documents/Example.odt
  2. Share Documents/Example.odt with demo
  3. Take another PROPFIND of /Documents/
  4. Compare etags for /Documents/
  5. Compare permissions for /Documents/Example.odt

Expected behaviour

  • the eTag for at least /Documents/ should change after sharing the file
  • the permissions for /Documents/Example.odt should include an S after sharing the file

Actual behaviour

  • no eTags change
  • no permissions change

You can see that the share was actually added by the addition of <oc:share-types> in the logs below.

Server configuration

demo.owncloud.com as of March 4th, 2019

ownCloud version: 10.1.0.4

Logs

PROPFIND of /Documents/ before sharing /Documents/Example.odt:

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
<d:response>
    <d:href>/remote.php/dav/files/admin/Documents/</d:href>
    <d:propstat>
        <d:prop>
            <d:resourcetype>
                <d:collection/>
            </d:resourcetype>
            <d:getlastmodified>Mon, 04 Mar 2019 10:23:19 GMT</d:getlastmodified>
            <d:getetag>"5c7cfc97c22d7"</d:getetag>
            <oc:id>00000091ocs7se16w8jy</oc:id>
            <oc:size>36227</oc:size>
            <oc:permissions>RDNVCK</oc:permissions>
            <oc:favorite>0</oc:favorite>
            <oc:share-types/>
            <oc:owner-display-name>admin</oc:owner-display-name>
        </d:prop>
        <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
        <d:prop>
            <d:getcontentlength/>
            <d:getcontenttype/>
        </d:prop>
        <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
</d:response>
<d:response>
    <d:href>/remote.php/dav/files/admin/Documents/Example.odt</d:href>
    <d:propstat>
        <d:prop>
            <d:resourcetype/>
            <d:getlastmodified>Mon, 04 Mar 2019 10:23:20 GMT</d:getlastmodified>
            <d:getcontentlength>36227</d:getcontentlength>
            <d:getcontenttype>application/vnd.oasis.opendocument.text</d:getcontenttype>
            <d:getetag>"341404dd5c75a411d5873392647683f7"</d:getetag>
            <oc:id>00000092ocs7se16w8jy</oc:id>
            <oc:size>36227</oc:size>
            <oc:permissions>RDNVW</oc:permissions>
            <oc:favorite>0</oc:favorite>
            <oc:share-types/>
            <oc:owner-display-name>admin</oc:owner-display-name>
        </d:prop>
        <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
</d:response>
</d:multistatus>

PROPFIND of /Documents/ after sharing /Documents/Example.odt:

<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
<d:response>
    <d:href>/remote.php/dav/files/admin/Documents/</d:href>
    <d:propstat>
        <d:prop>
            <d:resourcetype>
                <d:collection/>
            </d:resourcetype>
            <d:getlastmodified>Mon, 04 Mar 2019 10:23:19 GMT</d:getlastmodified>
            <d:getetag>"5c7cfc97c22d7"</d:getetag>
            <oc:id>00000091ocs7se16w8jy</oc:id>
            <oc:size>36227</oc:size>
            <oc:permissions>RDNVCK</oc:permissions>
            <oc:favorite>0</oc:favorite>
            <oc:share-types/>
            <oc:owner-display-name>admin</oc:owner-display-name>
        </d:prop>
        <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
        <d:prop>
            <d:getcontentlength/>
            <d:getcontenttype/>
        </d:prop>
        <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
</d:response>
<d:response>
    <d:href>/remote.php/dav/files/admin/Documents/Example.odt</d:href>
    <d:propstat>
        <d:prop>
            <d:resourcetype/>
            <d:getlastmodified>Mon, 04 Mar 2019 10:23:20 GMT</d:getlastmodified>
            <d:getcontentlength>36227</d:getcontentlength>
            <d:getcontenttype>application/vnd.oasis.opendocument.text</d:getcontenttype>
            <d:getetag>"341404dd5c75a411d5873392647683f7"</d:getetag>
            <oc:id>00000092ocs7se16w8jy</oc:id>
            <oc:size>36227</oc:size>
            <oc:permissions>RDNVW</oc:permissions>
            <oc:favorite>0</oc:favorite>
            <oc:share-types>
                <oc:share-type>0</oc:share-type>
            </oc:share-types>
            <oc:owner-display-name>admin</oc:owner-display-name>
        </d:prop>
        <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
</d:response>
</d:multistatus>

Activity

  1. ownclouders commented on Mar 4, 2019

    @ownclouders
    Contributor

    GitMate.io thinks possibly related issues are #22739 (Sharing permission issue), #4120 (Permission issues in shared folder), #16587 (Changing share permissions should trigger an etag change), #2838 (Shared Permissions not with PC Client), and #4520 (Sharing folders often does not give proper permissions).

  2. added this to the backlog milestone on Mar 4, 2019
  3. PVince81 commented on Mar 4, 2019

    @PVince81
    Contributor

    I'm suspecting a regression here, as in the past we did decide to have etag propagation for any changes related to shares and their permissions: #16587

    need some digging in the code and the past, bisecting, etc...

  4. PVince81 commented on Mar 4, 2019

    @PVince81
    Contributor

    this might also be two separate issues.

    I'm not 100% sure about etag propagation for creation.
    Still, the second part is odd: the shared folder should have the "S" flag set.

  5. felix-schwarz commented on Mar 4, 2019

    @felix-schwarz
    Author

    One thing that would be important for clients to be able to reliably pick up updates: the etag should change for every change to the sharing information.

    If etag updates were only triggered indirectly by a change of permissions, clients would only get a change indication after the first share being added to an item - and after the last share being removed from an item, f.ex.:

    1. user creates share on item
    2. enclosing folder etag is updated, item gains S permission
    3. client picks up changed etag, subsequently performs a PROPFIND on and requests all shares for items in the enclosing folder
    4. user creates another share on the same item (with the S permission already there, permissions wouldn't change)
    5. if the etag does not change again, the client would neither perform another PROPFIND nor re-request all shares for items in the enclosing folder

    The same issue would arise if the etag isn't updated when a different type of share is added to an item that's already shared. oc:share-types would change in the PROPFIND response for the item, but without a hint (by means of an updated etag), the client would not know it should look for changes like this. In case the client represents different types of shares differently in the UI, the UI could then show incorrect/outdated information.

  6. PVince81 commented on Mar 4, 2019

    @PVince81
    Contributor

    @davitol can you confirm this and compare with 8.2.11 and later ?

    The original PR says this was fixed in 8.2 so I expect that maybe it worked at some point then stopped working.

  7. modified the milestones: backlog, development on Mar 4, 2019
  8. davitol commented on Mar 11, 2019

    @davitol
    Contributor

    Tested in 8.2.6 and the issue is reproducible:

    1 - Take a PROPFIND of /Documents/ from [email protected] before sharing /Documents/Example.odt

    <?xml version="1.0" encoding="utf-8"?>
    <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
      <d:response>
        <d:href>/remote.php/webdav/Documents/</d:href>
        <d:propstat>
          <d:prop>
            <d:getlastmodified>Mon, 11 Mar 2019 08:21:21 GMT</d:getlastmodified>
            <d:resourcetype>
              <d:collection/>
            </d:resourcetype>
            <d:quota-used-bytes>0</d:quota-used-bytes>
            <d:quota-available-bytes>2595109407</d:quota-available-bytes>
            <d:getetag>"5c861a8139985"</d:getetag>
          </d:prop>
          <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
      </d:response>
      <d:response>
        <d:href>/remote.php/webdav/Documents/Example.txt</d:href>
        <d:propstat>
          <d:prop>
            <d:getlastmodified>Mon, 11 Mar 2019 08:21:19 GMT</d:getlastmodified>
            <d:getcontentlength>0</d:getcontentlength>
            <d:resourcetype/>
            <d:getetag>"8464a134512953502107009a169dbf39"</d:getetag>
            <d:getcontenttype>text/plain</d:getcontenttype>
          </d:prop>
          <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
      </d:response>
    </d:multistatus>
    

    2 - Share Documents/Example.txt with demo
    3 - Take another PROPFIND of /Documents/

    <?xml version="1.0" encoding="utf-8"?>
    <d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns">
      <d:response>
        <d:href>/remote.php/webdav/Documents/</d:href>
        <d:propstat>
          <d:prop>
            <d:getlastmodified>Mon, 11 Mar 2019 08:21:21 GMT</d:getlastmodified>
            <d:resourcetype>
              <d:collection/>
            </d:resourcetype>
            <d:quota-used-bytes>0</d:quota-used-bytes>
            <d:quota-available-bytes>2595109407</d:quota-available-bytes>
            <d:getetag>"5c861a8139985"</d:getetag>
          </d:prop>
          <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
      </d:response>
      <d:response>
        <d:href>/remote.php/webdav/Documents/Example.txt</d:href>
        <d:propstat>
          <d:prop>
            <d:getlastmodified>Mon, 11 Mar 2019 08:21:19 GMT</d:getlastmodified>
            <d:getcontentlength>0</d:getcontentlength>
            <d:resourcetype/>
            <d:getetag>"8464a134512953502107009a169dbf39"</d:getetag>
            <d:getcontenttype>text/plain</d:getcontenttype>
          </d:prop>
          <d:status>HTTP/1.1 200 OK</d:status>
        </d:propstat>
      </d:response>
    </d:multistatus>
    

    So the etags are not modified after the sharing in 8.2.6. I will test now in other versions

  9. davitol commented on Mar 11, 2019

    @davitol
    Contributor

    Also tested in oC 9.0.11.2. Same behavior. The issue happens

  10. PVince81 commented on Mar 12, 2019

    @PVince81
    Contributor

    ok thanks, it's as if this never worked properly before... will schedule some time to look at this

  11. modified the milestones: development, backlog on Mar 13, 2019
  12. PVince81 commented on Mar 19, 2019

    @PVince81
    Contributor

    not a regression then, this never worked correctly

  13. DeepDiver1975 commented on Mar 19, 2019

    @DeepDiver1975
    Contributor

    One Idea would be to use etag and ctag properly ......

  14. stale commented on Sep 20, 2021

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions