bugdavfs2 - Bugs: bug #56108, Always trust Content-Length rather...

 
 

bug #56108: Always trust Content-Length rather than getcontentlength

Submitter:  None
Submitted:  Tue 09 Apr 2019 09:12:47 AM UTC
   
 
Category:  None Severity:  1 - Wish
Item Group:  None Status:  Invalid
Privacy:  Public Assigned to:  _71007
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 10 Apr 2019 05:09:26 PM UTC, comment #1: 

To download resources that are created by the server on the fly you don't need davfs2. There are other clients for this kind of resources.

WebDAV was created to allow clients to edit resources on the server. And davfs2 maps WebDAV-resources into a local file system. If the server can't tell the size of a resource before you download it, then this resource is not suitable for a davfs2 file system.

Werner

- <_71007>
Tue 09 Apr 2019 09:12:47 AM UTC, original submission:  

Sometimes WebDAV server cannot know getcontentlength ahead-of-time because the content is generated on-the-fly. Although https://tools.ietf.org/html/rfc4918#section-15.4 is strict about the presence of getcontentlength, it is proposed that davfs2 is more lenient in processing entries with omitted getcontentlength.

Moreover, it is proposed that davfs2 always trusts Content-Length of the actual GET response, even if getcontentlength was previously read from container PROPFIND.

To reproduce:

1. Run attached test-server.py.

> python test-server.py

  • Serving Flask app "test-server" (lazy loading)
  • Environment: production

   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.


2. Mount with

> sudo mount -t davfs http://localhost:5000 webdav-test


3. Check resource contents. "File" test is reported correctly:

> sudo ls -la webdav-test

total 1
drwxr-xr-x 3 root root 104 Apr  9 11:53 .
drwx------ 2 root root   0 Apr  9 11:53 lost+found
-rw-r--r-- 1 root root   0 Apr  9 11:54 test

4. However, dumping "file" test only succeeds the second time:

> sudo cat webdav-test/test
> sudo cat webdav-test/test

Once upon a time...

It should successfully output the contents on the first attempt.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #46738:  test-server.py added by None (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by _71007 (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-12-26 _71007 Open/ClosedOpen Closed
    2019-04-10 _71007 Severity3 - Normal 1 - Wish
        StatusNone Invalid
        Assigned toNone _71007
    2019-04-09 None Attached File- Added test-server.py, #46738

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code