Bug 34171 - Bad user name reporting when file is locked in mixed Calc / Excel environment
Summary: Bad user name reporting when file is locked in mixed Calc / Excel environment
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
3.5.0 Beta2
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.3.0
Keywords:
: 64391 (view as bug list)
Depends on:
Blocks: File-Opening File-Lock
  Show dependency treegraph
 
Reported: 2011-02-11 02:35 UTC by Stefano Fraccaro
Modified: 2018-12-04 10:48 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
File opened by another user ("unknown") (29.59 KB, image/png)
2015-02-27 08:14 UTC, Marco A.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefano Fraccaro 2011-02-11 02:35:20 UTC
There is strange behaviour with file locking when xls file are accessed by LibreOffice and Excel. This behaviour (maybe) is common to all other program like Writer, Impress,...

Situation:

   * user A with Excel 2000
   * user B with LibreOffice 3.3 / OpenOffice 3.2

Example 1, step to reproduce:

   * user A open, modify,save and close "example.xml" file with Excel 2000
   * user B open "example.xml" with LibreOffice 3.3
   * user A open "example.xml" and Excel tell the user that file is
     opened by user A (expected: user B)
   * user A open "example.xml" with LibreOffice and the program tell
     the user that file is opened by user B (as expected)


Example 2, step to reproduce:

   * user B open, modify,save and close "example.xml" file with LibreOffice 3.3
   * user A open "example.xml" with Excel 2000
   * user B open "example.xml" and LibreOffice tell the user that file is
     opened by "unknown user" (expected: user A)
   * user B open "example.xml" with Excel and the program tell
     the user that file is opened by user A (as expected)

In mixed environment, Excel and Calc, seems that is not possible to know who is locking the file. If I know who is locking the file, for example, I could ask him to close the file.
Comment 1 Stefano Fraccaro 2011-02-11 02:54:34 UTC Comment hidden (obsolete)
Comment 2 Björn Michaelsen 2011-12-23 11:42:55 UTC Comment hidden (obsolete)
Comment 3 Stefano Fraccaro 2011-12-27 05:01:52 UTC
Same behaviour in LODev 3.5.0beta2 .  If you try to open a file that is already opened by Microsoft Excel, Lib0 tell me that the file is locked by "unknown user". This info is useful only if there is a name and if the name is correct.
Obviously, all software (Excel and LibO) have a registered user.
Comment 4 retired 2013-03-03 13:01:15 UTC
I tried reproducing this with LO 4.0.1.1 (nightly).

* I created an excel file and saved that to example.xml
* then Opened that file in LO while keeping excel open
* modify then tried to save file in LO
* choose XML (instead of odf)
-> crash (log: http://pastebin.com/iyiSbTZa)

This is still valid for LO 4.0.1.1. Also the crash is reproducible.

Setting platform from "Windows" to "All" since I'm on OS X.

Since this results in a reproducible crash of LO setting importance from "medium" to "high" and severity from "normal" to "major".

Maybe a dev can look into this?
Comment 5 m_a_riosv 2013-05-09 14:15:25 UTC
*** Bug 64391 has been marked as a duplicate of this bug. ***
Comment 6 bfoman (inactive) 2013-08-14 22:40:48 UTC
(In reply to comment #4)
> I tried reproducing this with LO 4.0.1.1 (nightly).
> * I created an excel file and saved that to example.xml
> * then Opened that file in LO while keeping excel open
> * modify then tried to save file in LO
> * choose XML (instead of odf)
> -> crash (log: http://pastebin.com/iyiSbTZa)

Seems this should be filed in new bug report.
Comment 7 retired 2013-08-15 09:20:38 UTC
bfoman: done: https://www.libreoffice.org/bugzilla/show_bug.cgi?id=68139

Not sure what's up with this bug here. Could you try reproducing with latest LO?
Comment 8 retired 2013-10-28 08:11:31 UTC
No feedback for 2 months. Setting to NEEDINFO.
Comment 9 Jean-Baptiste Faure 2014-01-02 19:01:49 UTC
Could some MS-Office / MS-Windows user explain how MS-Office's locking file system works? 
In the case of LibreOffice the name of the current user is filed in the lock file (.~lock.<filename>#).


Best regards. JBF
Comment 10 bfoman (inactive) 2014-01-02 21:31:27 UTC
(In reply to comment #9)
> Could some MS-Office / MS-Windows user explain how MS-Office's locking file
> system works? 
> In the case of LibreOffice the name of the current user is filed in the lock
> file (.~lock.<filename>#).

The same is for MS Office - you can find user data in the lock file ~$filename.
Comment 11 Jean-Baptiste Faure 2014-05-11 18:02:45 UTC
Thank you for the answer and sorry for taking it into account so late.
Can't test with MSO, so set status back to unconfirmed.

Best regards. JBF
Comment 12 Jean-Baptiste Faure 2014-05-11 18:04:43 UTC
set back importance and priority to default values because comment #4 is another bug.

Best regards. JBF
Comment 13 Jean-Baptiste Faure 2014-07-20 19:34:15 UTC
Sorry, my bad, the status of this bug report shouldn't be unconfirmed but new or needinfo. As the question in comment #7 has not been answered I set the status back to needinfo.

Best regards. JBF
Comment 14 QA Administrators 2015-02-19 04:33:08 UTC Comment hidden (obsolete)
Comment 15 Stefano Fraccaro 2015-02-23 09:31:09 UTC
I tried today with LibreOffice 4.4 (Windows) and Excel 2000 : the bug is still present. LibreOffice tell me that the file in locked by "Unknow user"
Comment 16 Marco A. 2015-02-27 07:42:33 UTC
I also still have the problem with LibO 4.4
Comment 17 Marco A. 2015-02-27 08:14:44 UTC
Created attachment 113729 [details]
File opened by another user ("unknown")

If I open the same document with Excell I see the name of the user
Comment 18 Buovjaga 2015-02-27 09:46:17 UTC
(In reply to Marco A. from comment #17)
> Created attachment 113729 [details]
> File opened by another user ("unknown")
> 
> If I open the same document with Excell I see the name of the user

It seems there was recently a commit that fixed this (bug 67534).
I was said "It will be available in 4.4.1."

Marco: 4.4.1 was released as stable. Can you please test with it?

Set to NEEDINFO.
Change back to UNCONFIRMED, if the problem persists. Change to RESOLVED DUPLICATE of 67534, if the problem went away.
Comment 19 Marco A. 2015-02-27 10:05:54 UTC
I try now, and still remain

LibO:
Versione: 4.4.1.2
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Versione locale: it_IT

Excel:
Excel 2003 SP3
Comment 20 Buovjaga 2015-02-27 10:11:45 UTC
Sorry, I guess it was a different fix. I'll actually set this to NEW as Marco is an independent confirmer.
Comment 21 tommy27 2016-04-16 07:22:32 UTC Comment hidden (obsolete)
Comment 22 Aron Budea 2016-05-21 04:18:45 UTC
Still occurs in 5.1.3.2.
Comment 23 Mike Kaganski 2018-02-19 04:20:22 UTC
Do we really need to care for foreign lock files? This might be inconvenient, but trying to "support" alien locking schemes (that aren't standardized) could bring more problems possibly. E.g., stale lockfiles of other programs. And why limit with only MSO? Let's do it for all possible office suites (and not only office - we support DXF - let's consider AutoCAD lock files, too)!
Comment 24 Mike Kaganski 2018-12-04 07:20:00 UTC
https://gerrit.libreoffice.org/64496
Comment 25 Mike Kaganski 2018-12-04 07:31:41 UTC
The proposed patch allows to check MS Office lockfiles ("Owner Files" in MS terminology [1]) when a document appears locked, and report the user name from it instead of "unknown user".

Please note that MS Excel (at least 2016) does *not* create owner files for XLS/XML documents, while it does that for XLSX documents; thus, it will be impossible to tell this information for those types of spreadsheets. OTOH, MS Word creates owner files for all types of tested documents (DOC/DOCX/RTF/ODT).

[1] https://support.microsoft.com/en-us/help/211632/description-of-how-word-creates-temporary-files
Comment 26 Commit Notification 2018-12-04 10:32:37 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/607b80ca3cddc239a35580470944a438ce144fc8%5E%21

tdf#34171: check foreign lockfiles to tell who has locked document

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.