[opencms-dev] Problem with LOCK in webdav support

Marcin Zajączkowski mszpak at wp.pl
Mon Aug 25 00:30:34 CEST 2008


Hi,


I very glad that OpenCms has webdav support which speed up many 
operations. Because I don't use Eclipse (and its webdav plugin) I 
installed davfs2 [1] - a Linux file system driver that allows you to 
mount a WebDAV server as a local file system, like a disk drive. 
Everything worked fine, except creating a new empty file. I asked an 
author of davfs2 about possible reason and after a log analyze I've got 
that answer.

[1] - http://dav.sourceforge.net/

<QUOTE>
When you try to create a new file, this is what happens:
 
The fuse kernel module tries to lookup the file and davfs2 answers "No 
such file or directory". This is ok.
FUSE_LOOKUP:
p 0x8bc0e88, aaa
RET: No such file or directory
 
Now your application tries to create a new file. The fuse kernel-module 
sends a request to create and open this new file:
FUSE_CREATE:
n 0x8bc0e88, f 0104101
pid 24271, mode 0100644
 
davfs2 first checks, whether a file with the same name exists on the 
server (somebody might have created one, since davfs2 did a PROPFIND).
HEAD /opencms/webdav/aaa HTTP/1.1
 
HTTP/1.1 404 Not Found
The 404 response from the server is ok. No such file exists, so we can 
create one.
 
davfs2 will now lock the file, to prevent everbody else from creating a 
file with the same name. Though the file does not exist on the server, 
locking is perfectly ok. It will reserve the name. This is part of the 
WebDAV-specification and a server that claims DAV-class-2-compliance 
MUST support this.
LOCK /opencms/webdav/aaa HTTP/1.1
 
*HTTP/1.1 404 Not Found*
The server replies with 404. This is a bug. The server must LOCK the 
not-yet-existing file, or must not claim to support LOCKS.
 
davfsr reports the error to the fuse kernel-module (maybe davfs2 should 
better send I/O-error instead of "No such file or directory".
RET: No such file or directory
</QUOTE>


As far as I saw in OpenCms there is a custom implementation of webdav 
(no external library). Because that issue could affect also other webdav 
clients would you be so kind to take a look on that and (if confirmed) 
preferable fix a problem.


Regards
Marcin




--
Ad...

----------------------------------------------------
Efekciarskie auta, noweczesne gadżety, wytworne szmatki.
Lajfstajlowy serwis dla koneserów prawdziwego luksusu.
Zobacz: http://klik.wp.pl/?adr=www.LuxClub.pl&sid=462





More information about the opencms-dev mailing list