Bug 47152

Summary: Lock files transferred when doing network copies
Product: LibreOffice Reporter: mycae
Component: LibreOfficeAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: normal CC: bfo.bugmail, sasha.libreoffice
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:

Description mycae 2012-03-09 07:03:32 UTC
Open a file on computer A, save the document in a new folder and then leave it open. Now grab the directory from computer B (eg via SFTP), disconnect computer B from the network, and try to edit the document. 


Receive error:
-----
Document file "blah.odp" is locked for editing by:

soandso (date)
Open document read-only or open a copy of the document for editing.
-----

Im not 100% sure how you could solve this, strategies such as checking for existing processes won't work, as you don't know if the resource is shared from B to A. Adding metadata to the lock itself might be useful, such as whether A locked a file on B, or if A locked a local file.

Adding a manual "clear lock" would go a long way, however.
Comment 1 mycae 2012-03-09 07:04:53 UTC
Sorry, there were two LO versions in this bug.

Computer A was using 
Opensuse, libreoffice-3.4.2.6-2.2.1.x86_64
Computer B
Debian, 1:3.4.5-4
Comment 2 sasha.libreoffice 2012-05-31 03:50:27 UTC
Thanks for bugreport
Gnome specific?
Comment 3 mycae 2012-05-31 06:00:56 UTC
No, not gnome specific.

This will also happen (i have discovered), if you cp -R , as the lock file gets duplicated.

It is inherent to using lock files, which can get duplicated when the document is duplicated, rather than only when the document is shared (ie write location is shared).
Comment 4 sasha.libreoffice 2012-05-31 23:40:14 UTC
Thanks for additional information
Currently LO asks if we want to edit document that has lock-file. And if we press "Edit anyway" then LO behaves as if we have no lock file. Very handy if LO was killed previously.

On network it is impossible to determine if document currently edited or not edited using information from lock-file. LO should just try to open document for writing. And if possible then it is up to user to see what to do.
Comment 5 bfoman (inactive) 2012-08-08 13:27:59 UTC
(In reply to comment #0)
> Im not 100% sure how you could solve this

Do not copy lock files or delete them afterwards.

Do not hesitate to reopen in case of mistriage.