Bug 137793 - LibreOffice doesn't remove the lock file after having opened a file and recognized that it has a read-only setting
Summary: LibreOffice doesn't remove the lock file after having opened a file and recog...
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-27 11:03 UTC by Mark Sammon
Modified: 2025-11-25 15:31 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Empty Spreadsheet, created as "new empty file", but then saved as xlsx and marked as "open in write protect mode" (4.71 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-04-26 10:00 UTC, Peter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Sammon 2020-10-27 11:03:10 UTC
A user has created a file in MS Excel and set it to protected mode which defaults the user to open the file in Read Only mode.

When opening the file in MS Excel, this correctly opens in Read Only mode and only when you try to "Enable Editing" does the file switch to Read-Write mode.

When opening (by double clicking on the file) the same file in LibreOffice it correctly opens in Read Only mode (as shown on the task bar) but it still creates a -lock file. When a second user opens the file in MS Excel or LibreOffice the file says it is locked and can only be opened in Read Only mode.


Now with the document closed in both Excel and LibreOffice ....
Open LibreOffice and from the File Menu, open the document but tick the "Read Only" checkbox and proceed to open the document.  Now the document pens but NO .~lock file is created.
Now when opening a second instance of the document from either LibreOffice or Excel the application correctly assumes the document is not locked by a user and thus opens the document. 


The bug here seems to be when you open the document by double clicking on the file and opening in LibreOffice instead of Opening the document in RO mode from the File/Open menu.


I have tested this in LibreOffice 6.4.5 and 7.0.0+

Thank you
Comment 1 [REDACTED] 2020-10-27 16:44:45 UTC
> 
> The bug here seems to be when you open the document by double clicking on
> the file and opening in LibreOffice instead of Opening the document in RO
> mode from the File/Open menu.
> 

From my perspective the issue is that LibreOffice doesn't honor the "Open Read-Only" setting from the document at all when it comes to create a lock file or not. A lock file is always created, regardless of the documents settings. Only selecting "Read-Only" in the file picker dialogs prevents from lock file creation.
Comment 2 [REDACTED] 2020-10-27 16:51:48 UTC
> From my perspective the issue is that LibreOffice doesn't honor the "Open
> Read-Only" setting from the document at all when it comes to create a lock
> file or not. A lock file is always created, regardless of the documents
> settings. Only selecting "Read-Only" in the file picker dialogs prevents
> from lock file creation.

... and I'd state the bug the following: LibreOffice doesn't remove the lock file after having opened a file and recognized that it has a read-only setting.
Comment 3 Xisco Faulí 2020-11-30 12:46:36 UTC
You can't confirm your own bugs. Moving it back to UNCONFIRMED until someone
else confirms it.
Comment 4 Justin L 2020-12-24 13:27:53 UTC
Attaching an example file in protected mode would be nice...
I tried to create a protected spreadsheet in Excel 2003, and failed.
Comment 5 Peter 2021-04-26 10:00:59 UTC
Created attachment 171410 [details]
Empty Spreadsheet, created as "new empty file", but then saved as xlsx and marked as "open in write protect mode"
Comment 6 Peter 2021-04-26 10:04:37 UTC
This is an (otherwise empty) spreadsheet. When opened in Calc by double clicking, there are created:
.~lock.OpenDocument Tabellendokument (neu).xlsx#
~$OpenDocument Tabellendokument (neu).xlsx

Calc is nevertheless in write protected mode.

Calc 7.0.4.2 (x64), Win 10
Comment 7 Peter 2021-04-26 10:06:50 UTC
Sorry, don't know which files are created (and immediatley deleted, maybe?). I meant "there are existing"
Comment 8 Peter 2021-04-26 13:18:50 UTC
example file added
Comment 9 Peter 2021-04-29 08:10:36 UTC
(In reply to Peter from comment #5)
> Created attachment 171410 [details]
> Empty Spreadsheet, created as "new empty file", but then saved as xlsx and
> marked as "open in write protect mode"

Of course the other way around. 1st created (by means of explorer's "new file" menu, opened with Calc 7.0.4.2, there marked as ..., then saved as xlsx
Comment 10 Xisco Faulí 2025-03-04 11:22:36 UTC
Hello,
It's been a while since this issue was reported.
Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 11 QA Administrators 2025-09-01 03:11:25 UTC Comment hidden (obsolete)
Comment 12 QA Administrators 2025-11-25 15:31:34 UTC
Dear Mark Sammon,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp