[Bug]: Cannot retrieve custom properties of metadata files through PROPFIND if it is from a file that has been shared with you
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
Cannot retrieve custom properties of metadata files through PROPFIND if it is from a file that has been shared with you
Steps to reproduce
- Create a
document.txtfile withuser1in root - Execute with curl these requests:
curl -u user1:user1 'http://localhost:8080/remote.php/dav/files/user1/document.txt' -X PROPPATCH --data '<?xml version="1.0" encoding="UTF-8"?>
<d:propertyupdate xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
<d:set>
<d:prop>
<nc:metadata-myapp-test>123</nc:metadata-myapp-test>
</d:prop>
</d:set>
</d:propertyupdate>'
curl -u user1:user1 'http://localhost:8080/remote.php/dav/files/user1/document.txt' -X PROPFIND --data '<?xml version="1.0" encoding="UTF-8"?>
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
<d:prop>
<nc:metadata-myapp-test />
</d:prop>
</d:propfind>'
Correct result:
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns"><d:response><d:href>/remote.php/dav/files/admin/document.txt</d:href><d:propstat><d:prop><nc:metadata-myapp-test/></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns"><d:response><d:href>/remote.php/dav/files/admin/document.txt</d:href><d:propstat><d:prop><nc:metadata-myapp-test>123</nc:metadata-myapp-test></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat></d:response></d:multistatus>
- Share the file of
user1withuser2and execute this request:
curl -u user2:user2 'http://localhost:8080/remote.php/dav/files/user2/document.txt' -X PROPFIND --data '<?xml version="1.0" encoding="UTF-8"?>
<d:propfind xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns">
<d:prop>
<nc:metadata-myapp-test />
</d:prop>
</d:propfind>'
Incorrect result (cannot find metadata-myapp-test):
<?xml version="1.0"?>
<d:multistatus xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns"><d:response><d:href>/remote.php/dav/files/local/document.txt</d:href><d:propstat><d:prop><nc:metadata-myapp-test/></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response></d:multistatus>
Expected behavior
It should return the results of the metadata-myapp-test property correctly as it does with those of the sharing user.
Nextcloud Server version
31
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.3
Web server
None
Database engine version
None
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the remote.php/dav/files/{user}/document.txt PROPFIND path and compare property handling for the owner and the recipient of a shared file. Reproduce the PROPPATCH and PROPFIND requests from the issue; done means the recipient receives metadata-myapp-test with value 123 and a 200 response for the shared file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100