Bug 144996 - FILESAVE XLSX Read-only passwords on XLSX files are not working
Summary: FILESAVE XLSX Read-only passwords on XLSX files are not working
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Tünde Tóth
URL:
Whiteboard: target:7.3.0 target:7.4.0
Keywords: filter:xlsx
Depends on:
Blocks: Password-Protected
  Show dependency treegraph
 
Reported: 2021-10-08 10:58 UTC by NISZ LibreOffice Team
Modified: 2022-04-06 10:55 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Excel with read-only password (5.11 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-10-08 11:00 UTC, NISZ LibreOffice Team
Details
Example file from Excel with read-only password v2 (9.19 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-10-11 06:55 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2021-10-08 10:58:11 UTC
Description:
This is a followup to bug 115933
The password protected "read only" property is ignored by Calc if the document created in Excel

Steps to Reproduce:
1.Open attached file in Calc
2.Enable editing mode
3.Save the document and close it
4.Open in Excel

Actual Results:
Notice that Excel ignore read only mode password

Expected Results:
It should needed a  password(“password”) for enter editing mode


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: c2de581d1943df2d84f2b71817b6a8bee41f0217
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: CL
Comment 1 NISZ LibreOffice Team 2021-10-08 11:00:06 UTC
Created attachment 175594 [details]
Example file from Excel with read-only password
Comment 2 Roman Kuznetsov 2021-10-08 13:36:44 UTC
I tried to open the file in MS Excel 2016. It didn't ask any password for editing. Why should LO do it?
Comment 3 NISZ LibreOffice Team 2021-10-11 06:55:29 UTC
Created attachment 175647 [details]
Example file from Excel with read-only password v2
Comment 4 Roman Kuznetsov 2021-10-11 16:55:31 UTC
(In reply to NISZ LibreOffice Team from comment #3)
> Created attachment 175647 [details]
> Example file from Excel with read-only password v2

Ah, I can confirm it in

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: fbfd91f2c5f4d66570c2d5a6f048b21f5d1671a4
CPU threads: 4; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

heh, 7.2 doesn't ask the password at all, it just allows to edit the document after editing mode enabling at once.
Comment 5 Commit Notification 2021-10-20 15:14:37 UTC
Tünde Tóth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/f138cc8fff47c4bb4fc361698bc788dd360a7dd7

tdf#144996 XLSX export: keep permission for editing on save

It will be available in 7.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.
Comment 6 Xisco Faulí 2021-10-22 15:22:27 UTC
This issue is not fixed in

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: d05c69a892535b910943fe98fbce42f5cc860aa4
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

in fact, if I open attachment 175647 [details] in LibreOffice, save it as XLSX and then open it again, the document is already in edit mode and I don't need the password to edit it
Comment 7 Xisco Faulí 2021-10-22 15:23:23 UTC
Beside, there is no difference comparing the output of LibreOffice with 
https://git.libreoffice.org/core/commit/f138cc8fff47c4bb4fc361698bc788dd360a7dd7 included and without it
Comment 8 NISZ LibreOffice Team 2021-11-08 13:40:01 UTC
Verified in: 

Version: 7.3.0.0.alpha1+ (x64) / LibreOffice Community
Build ID: 73334560b2dd2d60ac58d2cc2b1a5295490b03e1
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded
Comment 9 Xisco Faulí 2022-04-04 19:16:21 UTC
(In reply to Xisco Faulí from comment #6)
> This issue is not fixed in
> 
> Version: 7.3.0.0.alpha0+ / LibreOffice Community
> Build ID: d05c69a892535b910943fe98fbce42f5cc860aa4
> CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
> Locale: en-US (en_US.UTF-8); UI: en-US
> Calc: threaded
> 
> in fact, if I open attachment 175647 [details] in LibreOffice, save it as
> XLSX and then open it again, the document is already in edit mode and I
> don't need the password to edit it

This issue is still reproducible in

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: bd992ae1228b2f7e556f89f95949da0aeade5b91
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (es_ES.UTF-8); UI: en-US
Calc: threaded
Comment 10 Xisco Faulí 2022-04-04 19:16:50 UTC
(In reply to NISZ LibreOffice Team from comment #8)
> Verified in: 
> 
> Version: 7.3.0.0.alpha1+ (x64) / LibreOffice Community
> Build ID: 73334560b2dd2d60ac58d2cc2b1a5295490b03e1
> CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: default; VCL: win
> Locale: hu-HU (hu_HU); UI: hu-HU
> Calc: threaded

Hello NISZ,
Could you please explain what you did in order to verify this issue ?
Comment 11 NISZ LibreOffice Team 2022-04-05 08:25:42 UTC
Dear Xisco, 
The function is working correctly we chekd it. Please used the save,  because the function doesn't work with save as option.

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: a3988b2d147a2442b348d58b79dbd6e71472b7af
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: threaded
Comment 12 Xisco Faulí 2022-04-05 08:35:12 UTC
(In reply to NISZ LibreOffice Team from comment #11)
> Dear Xisco, 
> The function is working correctly we chekd it. Please used the save, 
> because the function doesn't work with save as option.
> 
> Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
> Build ID: a3988b2d147a2442b348d58b79dbd6e71472b7af
> CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL:
> win
> Locale: hu-HU (hu_HU); UI: en-US
> Calc: threaded

Hello NISZ team,
yes, the 'save' button works but it's not fixed by https://git.libreoffice.org/core/+/f138cc8fff47c4bb4fc361698bc788dd360a7dd7%5E%21, so if you revert it, you will see the issue is still fixed
Comment 13 Xisco Faulí 2022-04-05 08:44:28 UTC
oh, nevermind, I found what the patch fixes.

Steps to reproduce:
1. Open attachment 175647 [details]
2. Edit - Edit Mode
3. Introduce the password
4. Modify the file
5. Save
6. Reopen the document
7. Edit - Edit Mode

-> With the patch, the password dialog is prompted, without the patch it's not.
Sorry for the noise. Will report a separate issue for the 'save as' issue.
Comment 14 Commit Notification 2022-04-06 10:55:34 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c0919c6e5787dfb45f1a3e4b8b5ad6f1ff28f1ae

tdf#144996: sc: Add unittest

It will be available in 7.4.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.