Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

PROPFIND does not return custom file properties #57

Closed
individual-it opened this issue Jan 29, 2020 · 9 comments
Closed

PROPFIND does not return custom file properties #57

individual-it opened this issue Jan 29, 2020 · 9 comments
Assignees

Comments

@individual-it
Copy link
Member

request:

PROPFIND /remote.php/webdav/home/somefile.txt HTTP/1.1

<?xml version="1.0"?>
				<d:propfind
				   xmlns:d="DAV:"
				   xmlns:oc="http://owncloud.org/ns"
				   xmlns:ocs="http://open-collaboration-services.org/ns"
				   >
				    <d:prop><oc:privatelink/></d:prop>
				</d:propfind>

response

HTTP/1.1 207 Multi-Status

<?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/home/somefile.txt</d:href><d:propstat><d:prop></d:prop><d:status>HTTP/1.1 200 OK</d:status></d:propstat><d:propstat><d:prop><oc:privatelink></oc:privatelink></d:prop><d:status>HTTP/1.1 404 Not Found</d:status></d:propstat></d:response></d:multistatus>
@individual-it
Copy link
Member Author

probably same issue: setting a custom property works, but retrieving it only returns the property name but not the value

@individual-it
Copy link
Member Author

same with the quota property

@individual-it
Copy link
Member Author

same with checksums, no checksums are reported

curl -u user0:123456 -X PROPFIND http://localhost:9140/remote.php/dav/files/user0/textfile0.txt -d <?xml version="1.0"?> <d:propfind  xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns">  <d:prop>  <oc:checksums />  </d:prop></d:propfind>' | xmllint --format -

returns

<?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/dav/files/user0/textfile0.txt</d:href>
    <d:propstat>
      <d:prop/>
      <d:status>HTTP/1.1 200 OK</d:status>
    </d:propstat>
    <d:propstat>
      <d:prop>
        <oc:checksums/>
      </d:prop>
      <d:status>HTTP/1.1 404 Not Found</d:status>
    </d:propstat>
  </d:response>
</d:multistatus>

@individual-it individual-it changed the title PROPFIND does not return a private link PROPFIND does not return file properties Feb 13, 2020
@PVince81 PVince81 changed the title PROPFIND does not return file properties PROPFIND does not return custom file properties Apr 30, 2020
@PVince81
Copy link
Contributor

PVince81 commented May 6, 2020

as far as I can see, the PROPFIND seems to limit itself to known properties and not additional custom properties (there's a TODO for it though)

  • "propset": PROPPATCH response must contain "propstat" blocks with response status for each property, don't return a propfind response

@PVince81
Copy link
Contributor

PVince81 commented May 6, 2020

OUCH.
I've used the case from owncloud/core#32660, the result is broken XML:

<?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/litmus/</d:href>
   <d:propstat>
      <d:prop></d:prop>
      <d:status>HTTP/1.1 200 OK</d:status>
   </d:propstat>
   <d:propstat>
      <d:prop>
         <http://example.com/alpha:somename></http://example.com/alpha:somename>
         <http://example.com/beta:somename></http://example.com/beta:somename>
         <http://example.com/gamma:somename></http://example.com/gamma:somename>
         <http://example.com/delta:somename></http://example.com/delta:somename>
         <http://example.com/epsilon:somename></http://example.com/epsilon:somename>
         <http://example.com/zeta:somename></http://example.com/zeta:somename>
         <http://example.com/eta:somename></http://example.com/eta:somename>
         <http://example.com/theta:somename></http://example.com/theta:somename>
         <http://example.com/iota:somename></http://example.com/iota:somename>
         <http://example.com/kappa:somename></http://example.com/kappa:somename>
   </d:prop>
   <d:status>HTTP/1.1 404 Not Found</d:status>
   </d:propstat>
</d:response>
</d:multistatus>

It does return a propstat block but all props appear under 404.
This means it doesn't accept custom properties yet.

@PVince81
Copy link
Contributor

PVince81 commented May 6, 2020

here's a fix for the namespace issue in the response: cs3org/reva#720
doesn't fix setting arbitrary properties though

@PVince81
Copy link
Contributor

PVince81 commented May 6, 2020

as far as I can see, the properties were created as extended attributes:

% getfattr /var/tmp/reva/data/einstein/files/litmus
# file: litmus
user.oc.id
user.oc.md.http://example.com/alpha/somename
user.oc.md.http://example.com/beta/somename
user.oc.md.http://example.com/delta/somename
user.oc.md.http://example.com/epsilon/somename
user.oc.md.http://example.com/eta/somename
user.oc.md.http://example.com/gamma/somename
user.oc.md.http://example.com/iota/somename
user.oc.md.http://example.com/kappa/somename
user.oc.md.http://example.com/theta/somename
user.oc.md.http://example.com/zeta/somename

so the problem might be the retrieval

@PVince81 PVince81 self-assigned this May 6, 2020
@PVince81
Copy link
Contributor

PVince81 commented May 6, 2020

PR here: cs3org/reva#721

it seems that neither the PROPFIND nor the storage code were implemented to read custom properties

@PVince81 PVince81 closed this as completed May 7, 2020
@PVince81
Copy link
Contributor

PR to tidy up tests in core: owncloud/core#37419

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

No branches or pull requests

2 participants