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

unshared item also listed in the response while doing REPORT request by sharee #7092

Closed
nabim777 opened this issue Aug 22, 2023 · 1 comment · Fixed by #7192
Closed

unshared item also listed in the response while doing REPORT request by sharee #7092

nabim777 opened this issue Aug 22, 2023 · 1 comment · Fixed by #7192
Labels

Comments

@nabim777
Copy link
Member

nabim777 commented Aug 22, 2023

Describe the bug

When a file is shared with user(sharee) and sharee searches the shared file then the response contained unshared resources as well

Steps to reproduce

Steps to reproduce the behavior:

  1. As marie, create two folder folder1 and folder2
  2. As marie, upload a file file1.txt in folder1
  3. As marie, upload a file file2.txt in folder2
  4. As marie, share only one folder folder1 with einstein
  5. As einstein, accept the share request
  6. As einstein, search resources using file through API

search command:

curl -kv -XREPORT https://localhost:9200/remote.php/dav/spaces/<einstein-personal-id> \                                             
-u einstein:relativity \
-d "<?xml version='1.0' encoding='utf-8' ?>
<oc:search-files xmlns:a='DAV:' xmlns:oc='http://owncloud.org/ns' >
<oc:search>
<oc:pattern>file</oc:pattern>
</oc:search>
</oc:search-files>" | xmllint --format -

Expected behavior

The responses should contain only one shared item(file1)
< HTTP/1.1 207 Multi-Status
. . .
<?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%219d41ed40-ca4b-44b5-9ade-718237521a74:b4c2b61d-fdb5-4d7b-b26b-383764b044fe:0fd69b33-fca1-47c4-a7f4-e7673dafbb78/file1.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>9d41ed40-ca4b-44b5-9ade-718237521a74$b4c2b61d-fdb5-4d7b-b26b-383764b044fe!acb8ca90-4bdc-468b-8638-64f7d1e8b546</oc:fileid>
        <oc:file-parent>9d41ed40-ca4b-44b5-9ade-718237521a74$b4c2b61d-fdb5-4d7b-b26b-383764b044fe!fec69f5b-59d3-4d8d-99f0-218cd6d1f750</oc:file-parent>
        <oc:shareid>9d41ed40-ca4b-44b5-9ade-718237521a74:b4c2b61d-fdb5-4d7b-b26b-383764b044fe:0fd69b33-fca1-47c4-a7f4-e7673dafbb78</oc:shareid>
        <oc:shareroot>/folder1</oc:shareroot>
        <oc:name>file1.txt</oc:name>
        <d:getlastmodified>2023-08-22T08:46:11Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>S</oc:permissions>
        <oc:highlights/>
        <oc:tags/>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>0</d:getcontentlength>
        <oc:score>1.339842677116394</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

Actual behavior

The responses also contains unshared items(file2) which should not to be
< HTTP/1.1 207 Multi-Status
. . .
<?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%219d41ed40-ca4b-44b5-9ade-718237521a74:b4c2b61d-fdb5-4d7b-b26b-383764b044fe:0fd69b33-fca1-47c4-a7f4-e7673dafbb78/file1.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>9d41ed40-ca4b-44b5-9ade-718237521a74$b4c2b61d-fdb5-4d7b-b26b-383764b044fe!acb8ca90-4bdc-468b-8638-64f7d1e8b546</oc:fileid>
        <oc:file-parent>9d41ed40-ca4b-44b5-9ade-718237521a74$b4c2b61d-fdb5-4d7b-b26b-383764b044fe!fec69f5b-59d3-4d8d-99f0-218cd6d1f750</oc:file-parent>
        <oc:shareid>9d41ed40-ca4b-44b5-9ade-718237521a74:b4c2b61d-fdb5-4d7b-b26b-383764b044fe:0fd69b33-fca1-47c4-a7f4-e7673dafbb78</oc:shareid>
        <oc:shareroot>/folder1</oc:shareroot>
        <oc:name>file1.txt</oc:name>
        <d:getlastmodified>2023-08-22T08:46:11Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>S</oc:permissions>
        <oc:highlights/>
        <oc:tags/>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>0</d:getcontentlength>
        <oc:score>1.3035378456115723</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%219d41ed40-ca4b-44b5-9ade-718237521a74:b4c2b61d-fdb5-4d7b-b26b-383764b044fe:0fd69b33-fca1-47c4-a7f4-e7673dafbb78/folder2/file2.txt</d:href>
    <d:propstat>
      <d:prop>
        <oc:fileid>9d41ed40-ca4b-44b5-9ade-718237521a74$b4c2b61d-fdb5-4d7b-b26b-383764b044fe!dd574f91-4703-49c2-b972-66f158d53116</oc:fileid>
        <oc:file-parent>9d41ed40-ca4b-44b5-9ade-718237521a74$b4c2b61d-fdb5-4d7b-b26b-383764b044fe!5de2a90b-d1fa-4db2-a70d-9655f96d5612</oc:file-parent>
        <oc:shareid>9d41ed40-ca4b-44b5-9ade-718237521a74:b4c2b61d-fdb5-4d7b-b26b-383764b044fe:0fd69b33-fca1-47c4-a7f4-e7673dafbb78</oc:shareid>
        <oc:shareroot>/folder1</oc:shareroot>
        <oc:name>file2.txt</oc:name>
        <d:getlastmodified>2023-08-22T08:46:21Z</d:getlastmodified>
        <d:getcontenttype>text/plain</d:getcontenttype>
        <oc:permissions>S</oc:permissions>
        <oc:highlights/>
        <oc:tags/>
        <d:getetag/>
        <d:resourcetype/>
        <d:getcontentlength>0</d:getcontentlength>
        <oc:score>1.3035378456115723</oc:score>
      </d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>
@saw-jan saw-jan changed the title unshared item response come while doing REPORT request by sharee unshared item also listed in the response while doing REPORT request by sharee Aug 23, 2023
@kobergj
Copy link
Collaborator

kobergj commented Sep 1, 2023

Same issue as for the hotfix: #7184

Will backmerge once the hotfix landed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants