Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix shareroot path in REPORT responses #4859

Merged
merged 3 commits into from
Oct 20, 2022
Merged

fix shareroot path in REPORT responses #4859

merged 3 commits into from
Oct 20, 2022

Conversation

C0rby
Copy link
Contributor

@C0rby C0rby commented Oct 19, 2022

When doing a REPORT request the shareroot attribute contained the path /folder/test.txt even though only test.txt was shared with a user.
Now the response contains /test.txt.

Responses look like this now:

<?xml version="1.0"?>
<d:multistatus xmlns:s="http://sabredav.org/ns" xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">
  <d:response>
    <d:href>/remote.php/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%211284d238-aa92-42ce-bdc4-0b0000009157:01a54531-bf53-440e-972e-01a5f053c0d7:37249330-862f-44f5-8736-eea58feadb46</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$01a54531-bf53-440e-972e-01a5f053c0d7!3cbbda33-1e52-4aca-b9e7-4dd27981f567</oc:fileid>
        <oc:file-parent>1284d238-aa92-42ce-bdc4-0b0000009157$01a54531-bf53-440e-972e-01a5f053c0d7!42503198-a6e9-4975-bd07-5f7fcdaf239c</oc:file-parent>
        <oc:shareid>1284d238-aa92-42ce-bdc4-0b0000009157:01a54531-bf53-440e-972e-01a5f053c0d7:37249330-862f-44f5-8736-eea58feadb46</oc:shareid>
        <oc:shareroot>/test.txt</oc:shareroot>
        <oc:name>test.txt</oc:name>
        <d:getlastmodified>2022-10-18T13:22:29Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>SRM</oc:permissions>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>13</d:getcontentlength>
        <oc:score>1.803070306777954</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%211284d238-aa92-42ce-bdc4-0b0000009157:01a54531-bf53-440e-972e-01a5f053c0d7:5e95ec29-77b8-40b7-9e4c-55f8c42bcd87</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$01a54531-bf53-440e-972e-01a5f053c0d7!7f26798b-b29b-4018-a7dd-b1c8fa238ba6</oc:fileid>
        <oc:file-parent>1284d238-aa92-42ce-bdc4-0b0000009157$01a54531-bf53-440e-972e-01a5f053c0d7!01a54531-bf53-440e-972e-01a5f053c0d7</oc:file-parent>
        <oc:shareid>1284d238-aa92-42ce-bdc4-0b0000009157:01a54531-bf53-440e-972e-01a5f053c0d7:5e95ec29-77b8-40b7-9e4c-55f8c42bcd87</oc:shareid>
        <oc:shareroot>/test.txt</oc:shareroot>
        <oc:name>test.txt</oc:name>
        <d:getlastmodified>2022-10-18T13:22:11Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>SRM</oc:permissions>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>8</d:getcontentlength>
        <oc:score>1.803070306777954</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%211284d238-aa92-42ce-bdc4-0b0000009157:01a54531-bf53-440e-972e-01a5f053c0d7:a637933e-1298-4e7d-b8d9-4ae5db34826e/folder3test.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$01a54531-bf53-440e-972e-01a5f053c0d7!00e6e92b-a3aa-4e27-aa2a-2fb98625dbde</oc:fileid>
        <oc:file-parent>1284d238-aa92-42ce-bdc4-0b0000009157$01a54531-bf53-440e-972e-01a5f053c0d7!915bf533-f215-4e81-8e5c-f8b99d3e01e7</oc:file-parent>
        <oc:shareid>1284d238-aa92-42ce-bdc4-0b0000009157:01a54531-bf53-440e-972e-01a5f053c0d7:a637933e-1298-4e7d-b8d9-4ae5db34826e</oc:shareid>
        <oc:shareroot>/folder3</oc:shareroot>
        <oc:name>folder3test.txt</oc:name>
        <d:getlastmodified>2022-10-19T12:57:35Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>SR</oc:permissions>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>7</d:getcontentlength>
        <oc:score>1.1522295475006104</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%211284d238-aa92-42ce-bdc4-0b0000009157:01a54531-bf53-440e-972e-01a5f053c0d7:9b80c8b8-4045-44f7-8dd9-13b5fc617cd8/folder2test.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$01a54531-bf53-440e-972e-01a5f053c0d7!5c7b2e53-42d8-424e-842c-f7127ead03b1</oc:fileid>
        <oc:file-parent>1284d238-aa92-42ce-bdc4-0b0000009157$01a54531-bf53-440e-972e-01a5f053c0d7!1d02ac2b-ff7c-4f1b-99f0-b74720c90327</oc:file-parent>
        <oc:shareid>1284d238-aa92-42ce-bdc4-0b0000009157:01a54531-bf53-440e-972e-01a5f053c0d7:9b80c8b8-4045-44f7-8dd9-13b5fc617cd8</oc:shareid>
        <oc:shareroot>/folder2</oc:shareroot>
        <oc:name>folder2test.txt</oc:name>
        <d:getlastmodified>2022-10-19T12:57:03Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>SR</oc:permissions>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>7</d:getcontentlength>
        <oc:score>0.7507680058479309</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
  <d:response>
    <d:href>/remote.php/dav/spaces/a0ca6a90-a365-4782-871e-d44447bbc668%211284d238-aa92-42ce-bdc4-0b0000009157:01a54531-bf53-440e-972e-01a5f053c0d7:9b80c8b8-4045-44f7-8dd9-13b5fc617cd8/subfolder2/subfolder2test.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>1284d238-aa92-42ce-bdc4-0b0000009157$01a54531-bf53-440e-972e-01a5f053c0d7!c8c173dc-596e-4334-aac8-c673faf854cf</oc:fileid>
        <oc:file-parent>1284d238-aa92-42ce-bdc4-0b0000009157$01a54531-bf53-440e-972e-01a5f053c0d7!6e4b9353-d889-4323-8dbb-bcf00f7576f4</oc:file-parent>
        <oc:shareid>1284d238-aa92-42ce-bdc4-0b0000009157:01a54531-bf53-440e-972e-01a5f053c0d7:9b80c8b8-4045-44f7-8dd9-13b5fc617cd8</oc:shareid>
        <oc:shareroot>/folder2</oc:shareroot>
        <oc:name>subfolder2test.txt</oc:name>
        <d:getlastmodified>2022-10-19T14:48:53Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>SR</oc:permissions>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>10</d:getcontentlength>
        <oc:score>0.7507680058479309</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Code changes

@C0rby C0rby requested review from kobergj and micbar October 19, 2022 15:04
@C0rby C0rby self-assigned this Oct 19, 2022
@C0rby C0rby force-pushed the received-share-path branch from e9a11df to bbcbf69 Compare October 20, 2022 08:26
@ScharfViktor
Copy link
Contributor

CI is red due #4849 Try to restart

@ScharfViktor
Copy link
Contributor

or can we bump WEB_COMMIT=1e20bc5fbaf396930ca5b9c5c584b3ad2a9dc1c6 here?

@C0rby
Copy link
Contributor Author

C0rby commented Oct 20, 2022

or can we bump WEB_COMMIT=1e20bc5fbaf396930ca5b9c5c584b3ad2a9dc1c6 here?

I'll try that here. Let's see if that already fixes it. 👍

@ScharfViktor
Copy link
Contributor

ScharfViktor commented Oct 20, 2022

new fail (another test). User-viewer of the project space has an available "delete" button in the trash bin:
Screenshot 2022-10-20 at 11 36 27

expected behavior: no available button "delete" on the web
image

@ScharfViktor
Copy link
Contributor

it looks like web is old but e2e tests use this code: owncloud/web@eea0f23
With the new commit we fixed one test but broke another

brought web commit back
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@C0rby
Copy link
Contributor Author

C0rby commented Oct 20, 2022

Let's hope this works now. 👍

@ScharfViktor
Copy link
Contributor

Let's hope this works now. 👍

e2e has passed, sorry for the confusion

@C0rby
Copy link
Contributor Author

C0rby commented Oct 20, 2022

Perfect, thank you very much. 👍

@C0rby C0rby merged commit 0747540 into master Oct 20, 2022
@delete-merged-branch delete-merged-branch bot deleted the received-share-path branch October 20, 2022 11:56
ownclouders pushed a commit that referenced this pull request Oct 20, 2022
Merge: cccb190 d82003f
Author: David Christofas <[email protected]>
Date:   Thu Oct 20 13:56:04 2022 +0200

    Merge pull request #4859 from owncloud/received-share-path

    fix shareroot path in REPORT responses
@micbar micbar mentioned this pull request Nov 25, 2022
73 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Received shares exposed with share owner path instead of mount point
3 participants