Bug 37073 - FILESAVE: Writer does not ask for DAV authentication if file opened from linked WebDAV share in Windows
Summary: FILESAVE: Writer does not ask for DAV authentication if file opened from link...
Status: RESOLVED DUPLICATE of bug 96410
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.4 release
Hardware: x86-64 (AMD64) Windows (All)
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: WebDAV
  Show dependency treegraph
 
Reported: 2011-05-10 08:33 UTC by Andre Gemuend
Modified: 2018-04-21 09:10 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example document (21.08 KB, application/vnd.oasis.opendocument.text)
2012-07-03 10:04 UTC, Andre Gemuend
Details
First error message (will be repeated once) (125.39 KB, image/png)
2012-07-03 10:09 UTC, Andre Gemuend
Details
Second error message (120.05 KB, image/png)
2012-07-03 10:10 UTC, Andre Gemuend
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Gemuend 2011-05-10 08:33:11 UTC
System: Windows 7 Professional 
Version 6.1 (Build 7601: Service Pack 1)

LibreOffice: Reproduced in both 3.3.1 and 3.3.2

If you open a file from a so-called "web folder", a linked webdav resource in windows, and try to save your changes back to the file, OpenOffice will fail saving it, and that actually renders the file useless subsequently. It works flawlessly in other programs, such as Microsoft Word, or if opened from the file dialog instead of from the explorer. The folder is password protected using Auth Digest.

On saving the file, you will retrieve three error dialogs, two times access denied and then I/O error. 

The exact error messages:

"Error saving the document Test:
Access to \\dav....\DavWWWRoot\Test.odt was denied."

and

"Error saving the document Test:
General Error.
General input/output error."

The bad thing is that afterwards the file is corrupt for all other programs as well. 

The webdav server (Apache 2 mod_dav in my case) reports:

[Tue May 10 15:06:28 2011] [error] [client 127.0.0.1] Could not LOCK /Test.odt due to a failed precondition (e.g. other locks).  [423, #0]
[Tue May 10 15:06:28 2011] [error] [client 127.0.0.1] (2)No such file or directory: Existing lock(s) on the requested resource prevent an exclusive lock.  [423, #0]

Apparently, LibreOffice never releases the lock. This is confirmed by looking at the file properties with cadaver:

dav:/> propget Test.odt
Fetching properties for `Test.odt':
Win32CreationTime = Tue, 10 May 2011 15:06:13 GMT
Win32LastModifiedTime = Tue, 10 May 2011 15:06:26 GMT
Win32LastAccessTime = Tue, 10 May 2011 15:06:26 GMT
Win32FileAttributes = 00000020
resourcetype =
creationdate = 2011-05-10T15:06:27Z
getcontentlength = 0
getlastmodified = Tue, 10 May 2011 15:06:27 GMT
getetag = "43009c-0-4cd7c2c0"
executable = F
supportedlock =
<lockentry>
<lockscope><exclusive></exclusive></lockscope>
<locktype><write></write></locktype>
</lockentry>
<lockentry>
<lockscope><shared></shared></lockscope>
<locktype><write></write></locktype>
</lockentry>

lockdiscovery = <activelock>
<locktype><write></write></locktype>
<lockscope><exclusive></exclusive></lockscope>
<depth>infinity</depth>
<owner><href>username</href></owner><timeout>Second-3536</timeout>
<locktoken>
<href>opaquelocktoken:31370189-a889-4d76-8bc8-f214d6d804cd</href>
</locktoken>
</activelock>

getcontenttype = application/vnd.oasis.opendocument.text


Configuration of the WebDAV folder:

        <Directory /var/www/..../dav>
          Options Indexes FollowSymLinks MultiViews
          AllowOverride None
          Order allow,deny
          allow from all

          DAV on
          AuthType Digest
          AuthName "...."
          AuthDigestDomain / http://.../
          AuthDigestProvider file
          AuthUserFile  /var/www/..../dav.digest
          Require valid-user
        </Directory>

Steps to reproduce:
 - Set up a webdav share as described e.g. here: http://www.howtoforge.com/how-to-set-up-webdav-with-apache2-on-centos-5.5
 - copy an ODF file to this WebDAV folder and try saving some changes
 - Afterwards see if you can open it in any other program (or try deleting or renaming the file). 


Please note that it works okay, if you open the file from the LibreOffice file dialog. If you start with an empty Writer, open the file open dialog and enter the DAV URL, it asks correctly for the password and can save the file! If opened directly from explorer, it never asks for the password.
Comment 1 Andre Gemuend 2011-05-10 08:46:35 UTC
Now that I look at my report again, perhaps the problem is that the file is opened using that windows "mount point", as \\$server\DavWWWRoot\$filename instead of through the real URI. There must still be something special in LibreOffice, though, because that works in other programs such as Notepad++ without asking for the credentials. Microsoft Word asks seperately for authentication, though. Perhaps the fix could be to determine that the file is indeed lying in a webdav folder?
Comment 2 Björn Michaelsen 2011-12-23 12:02:50 UTC Comment hidden (obsolete)
Comment 3 Rainer Bielefeld Retired 2012-06-19 23:49:06 UTC
@Andre Gemuend:
Please attach a sample document!
Comment 4 Andre Gemuend 2012-07-03 10:04:45 UTC
Created attachment 63775 [details]
Example document

The content of the file is completely irrelevant. This is just lipsum.
Comment 5 Andre Gemuend 2012-07-03 10:09:54 UTC
Created attachment 63776 [details]
First error message (will be repeated once)

This is the first error message that appears upon saving.
Comment 6 Andre Gemuend 2012-07-03 10:10:50 UTC
Created attachment 63777 [details]
Second error message

This is the second error message. No matter if you discard your changes afterwards, the file will be a 0-byte file entry that is forever locked on your webdav server.
Comment 7 Andre Gemuend 2012-07-03 10:11:43 UTC
Confirmed in 3.5 as shown in the screenshots.
Comment 8 Andre Gemuend 2012-07-03 10:13:12 UTC
Sorry, in 

LibreOffice 3.5.4.2 
Build ID: 165a79a-7059095-e13bb37-fef39a4-9503d18

to be precise.
Comment 9 Christopher POTTER 2013-03-14 10:37:24 UTC
We confirm that this longstanding bug still occurs on LibreOffice 4.0.x (Windows)
Comment 10 Christopher POTTER 2013-03-14 10:56:11 UTC
Some additional logs on the server side (webdav alfresco). The webdav error is an '400 bad request' when trying to unlock

11:43:04,872 DEBUG [org.alfresco.webdav.protocol] Properties of the FileInfo[name=Nouveau Texte OpenDocument.odt, isFolder=false, nodeRef=workspace://Spac      esStore/dbf16368-694b-4404-a440-c61f9dac2bfd] was changed
11:43:05,367 INFO  [org.alfresco.webdav.protocol] LOCK took 568ms to execute [/alfresco/webdav/Espaces%20Utilisateurs/cpotter/Nouveau%20Texte%20OpenDocume      nt.odt]
11:43:05,712 DEBUG [org.alfresco.webdav.protocol] WebDAV request UNLOCK on path /alfresco/webdav/Espaces%20Utilisateurs/cpotter/Nouveau%20Texte%20OpenDocu      ment.odt
11:43:05,712 DEBUG [org.alfresco.webdav.protocol] Parsing Lock-Token header: opaquelocktoken:dbf16368-694b-4404-a440-c61f9dac2bfd:cpotter
11:43:05,712 DEBUG [org.alfresco.webdav.protocol] UNLOCK is returning status code: 400
11:43:05,712 INFO  [org.alfresco.webdav.protocol] UNLOCK took 0ms to execute [/alfresco/webdav/Espaces%20Utilisateurs/cpotter/Nouveau%20Texte%20OpenDocume      nt.odt]
11:43:05,930 DEBUG [org.alfresco.webdav.protocol] WebDAV request PROPFIND on path /alfresco/webdav/Espaces%20Utilisateurs/cpotter/Nouveau%20Texte%20OpenDo      cument.odt
11:43:05,931 DEBUG [org.alfresco.webdav.protocol] Fetched node for path:
   servlet path: /webdav
11:43:05,932 INFO  [org.alfresco.webdav.protocol] PROPFIND took 2ms to execute [/alfresco/webdav/Espaces%20Utilisateurs/cpotter/Nouveau%20Texte%20OpenDocu      ment.odt]
11:43:06,154 DEBUG [org.alfresco.webdav.protocol] WebDAV request LOCK on path /alfresco/webdav/Espaces%20Utilisateurs/cpotter/Nouveau%20Texte%20OpenDocume      nt.odt
11:43:06,154 DEBUG [org.alfresco.webdav.protocol] Parsing If header: null
11:43:06,154 DEBUG [org.alfresco.webdav.protocol] Timeout=3600, depth=-1
11:43:06,155 DEBUG [org.alfresco.webdav.protocol] Locking node:
11:43:06,156 DEBUG [org.alfresco.webdav.protocol] Fetched node for path:
   servlet path: /webdav
11:43:06,156 DEBUG [org.alfresco.webdav.protocol] LOCK is returning status code: 423
11:43:06,156 INFO  [org.alfresco.webdav.protocol] LOCK took 2ms to execute [/alfresco/webdav/Espaces%20Utilisateurs/cpotter/Nouveau%20Texte%20OpenDocument      .odt]
Comment 11 Thomas Steinel 2014-02-19 16:35:34 UTC
the UNLOCK request does not provide a valid LOCKTOKEN
as described here https://tools.ietf.org/html/rfc2518#section-6.4

Logged via mod_dumpio:

[Wed Feb 19 15:23:01 2014] [debug] mod_dumpio.c(74): mod_dumpio:  dumpio_in (data-HEAP): Lock-Token: <645c1b74-adfc-4567-bb28-be263a80251f>\r\n


I guess it shoud be :
Lock-Token: <opaquelocktoken:645c1b74-adfc-4567-bb28-be263a80251f>
Comment 12 Joel Madero 2015-05-02 15:41:47 UTC Comment hidden (obsolete)
Comment 13 Peter Vilhan 2015-09-12 08:13:05 UTC
Libreoffice: 4.4.5.2 on ubuntu 14.04 64bit 

The bug is still present.

Error in webdav log:
Could not LOCK /tst2.odt due to a failed precondition (e.g. other locks).  [423, #0]
[Sat Sep 12 09:52:10 2015] [error] [client 89.173.110.139] (2)No such file or directory: Existing lock(s) on the requested resource prevent an exclusive lock.  [423, #0]
Comment 14 QA Administrators 2016-09-20 10:31:57 UTC Comment hidden (obsolete)
Comment 15 Xisco Faulí 2017-10-17 08:25:36 UTC
I guess this can be closed as duplicate of bug 96410

*** This bug has been marked as a duplicate of bug 96410 ***
Comment 16 Andre Gemuend 2018-04-21 09:10:20 UTC
Should it, really? This one was reported more than 4 and a half years earlier than 96410. Does it describe the same situation?