maindavfs2 - Support: sr #109230, URL encode remote filenames for...

 
 

sr #109230: URL encode remote filenames for compatibility

Submitter:  James <donjaime>
Submitted:  Sat 21 Jan 2017 04:08:48 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Need Info
Privacy:  Public Assigned to:  _71007
Open/Closed:  Closed Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 08 Feb 2017 10:45:48 AM UTC, comment #4: 

So 1und1 changed their server software. They fixed the if_match_bug and introduced new ones.

Characters that cannot be used
------------------------------
This is a voluntary decision of 1und1, other WebDAV-providers have different rules and there is no standard or technical reason for this. They probably believe that they avoid problems with some clients by not allowing these characters.

URL-encoding does not help. Most of these characters are percent-encoded by davfs2 according to the specs. The server of 1und1 recognices these encoded characters and then decides that they are not allowed.

Example: "test?" is percent-encoded by davfs2 into "test%3f". The server receives "test%3f" and recognices that "%3f" stands for "?" and responds with 403 Forbidden.
You simply have to avoid these characters with 1und1. It will be different with different WebDAV-providers.

Why don't you get an error message
----------------------------------
Of course you should get an error message when you try to create a file with forbidden characters in the name.

What happens is this:
Your application opens a file for writing, say test?. davfs2 will now request a lock for this file or file name on the server (a lock for test%3f). Unfortunately this is successful. The server grants a lock for test%3f. Therefor davfs2 can't know that this file name is not allowed.

Later, when writing to the file is finished and the file is closed davfs2 will upload this file to the server. It uses the same file name (test%3f) and the lock-token it received from the server. Now the server returns 403 forbidden. davfs2 will answer the close-request from the kernel with error EINVAL ("Das Argument ist ungültig"). But applications usually ignore errors on close (they can't do anything about it anyway).

The error is on the side of the server: If it does not allow the file name "test%3f" then it must not grant a lock for this file name but return an error status code.

KDE dolphin can inform you about this error directly through its user interface. It does not depend on the kernel and some application to transfer error messages to you, like davfs2 does.

- <_71007>
Mon 06 Feb 2017 11:25:06 AM UTC, comment #3: 

My provider says (https://hilfe-center.1und1.de/tarifergaenzungen-c85328/cloud-c85338/1und1-online-speicher-c84531/nutzungsgrenzen-des-1und1-online-speichers-a787725.html) I cannot use these characters in file or folder names: ? > |* > : " \ / +

An option to escape these characters on the remote server would be useful. If they are not restricted by webdav itself, it would have to be possible to specify which characters should be escaped. If such an option is not provided, davfs2 should at least report an error if a filename is not accepted by the remote server.

If I mount my storage at /mnt and do
$ cp bong\:bang.txt /mnt/
the command completes, but the file is not in /mnt.
$ ls /mnt/lost+found/
bong:bang.txt-fGiHVO
No error is reported when I unmount. The file is still in the cache directory.

If I try to upload the file through the web interface, I get an error message "Diese Aktion ist aktuell leider nicht möglich."

If I try to upload it using kde dolphin webdavfs: protocol I get an access denied error.

James <donjaime>
Sat 21 Jan 2017 04:18:15 PM UTC, comment #2: 

There are no "dav-incompatible filenames" (with the one exception that the slash-character "/" is reserved for use as separator).

davfs2 already escapes problematic characters according to the rules.

Please describe your problem as clear and as complete as possible. Give some examples of what you think are illegal file names and report what happens when you use them. If you have some other kind of access to your WebDAV storage then please tell how these illegal filenames are treated on the server or by the web interface.

Werner

- <_71007>
Sat 21 Jan 2017 04:08:48 PM UTC, comment #1: 

This item has been reassigned from the project davfs2 bugs tracker to your tracker.

The original report is still available at bugs #50110

Following are the information included in the original report:

[field #0]                  Item ID: 50110
[field #1]                 Group ID: 10199
[field #2]              Open/Closed: Open
[field #3]                 Severity: 3 - Normal
[field #4]                  Privacy: Public
[field #8]                         : Unknown bugs Field Display Type
[field #9]                 Category: None
[field #10]             Submitted by: donjaime
[field #11]              Assigned to: None
[field #12]             Submitted on: Sat 21 Jan 2017 12:10:26 PM GMT
[field #13]                  Summary: URL encode remote filenames for compatibility
[field #14]      Original Submission: It would be useful to have an option to escape dav-incompatible filenames on the remote server.

For example: my ISP provides me with cloud storage accessible through WEBDAV. I can use it to back up my data, but I need to make sure that there are no illegal characters in the filenames.
[field #16]               Item Group: None
[field #17]                   Status: None
[field #18]        Component Version: None
[field #19]         Operating System: None
[field #20]          Reproducibility: None
[field #21]               Size (loc): None
[field #22]            Fixed Release: None
[field #23]          Planned Release: None
[field #24]                   Effort: 0.00
[field #28]                 Priority: 5 - Normal
[field #31]         Percent Complete: 0%
[field #33]                  Release: None
[field #58]     Custom Select Box #1: None
[field #59]     Custom Select Box #2: None
[field #60]     Custom Select Box #3: None
[field #61]     Custom Select Box #4: None
[field #62]     Custom Select Box #5: None
[field #63]     Custom Select Box #6: None
[field #64]     Custom Select Box #7: None
[field #65]     Custom Select Box #8: None
[field #66]     Custom Select Box #9: None
[field #67]    Custom Select Box #10: None

- <_71007>
Sat 21 Jan 2017 04:08:48 PM UTC, original submission:  

It would be useful to have an option to escape dav-incompatible filenames on the remote server.

For example: my ISP provides me with cloud storage accessible through WEBDAV. I can use it to back up my data, but I need to make sure that there are no illegal characters in the filenames.

James <donjaime>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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)
  • -email is unavailable- added by donjaime (Submitted the item)
  •  

    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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-12-26 _71007 Open/ClosedOpen Closed
    2017-01-21 _71007 StatusNone Need Info
        Assigned toNone _71007
    2017-01-21 _71007 Reassign itemdavfs2, bug #50110 davfs2, sr #109230

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code