Bug 129829 - password protection with readonly disables editing in 6.5.0.0.a0+ dev, edit mode blocked, edit password not working
Summary: password protection with readonly disables editing in 6.5.0.0.a0+ dev, edit m...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha0+
Hardware: All Windows (All)
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:6.5.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2020-01-06 10:46 UTC by b.
Modified: 2020-01-28 10:10 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
error message when trying to enable editing (14.58 KB, image/jpeg)
2020-01-06 14:44 UTC, b.
Details
file saved with password, unable to edit in dev 6.5.0.0.a0+ (12.09 KB, application/vnd.oasis.opendocument.spreadsheet)
2020-01-06 14:45 UTC, b.
Details

Note You need to log in before you can comment on or make changes to this bug.
Description b. 2020-01-06 10:46:48 UTC
Description:
when saving a file protected with a password there is a option to set it readonly, with an additional password to enable modifications. the unlocking for edit mode <strg-shift-m> or <edit-edit mode> doesn't work in actual dev version. 

despite entering the correct password you get a nice info as in the attachement on next comment. 

sample sheet in 2. comment, password to open is test, password for edit mode is test1. 

Steps to Reproduce:
1. open file from next but one comment, password 'test', 
2. try activating edit mode, password is 'test1', 
3. see not working but error message 'possibly access rights ... '

or: 

1. save a file with password protection, 
1a. in that choose 'options - open read only' and set a editing password, 
2. close the file, 
3. reopen it, provide read password, 
4. try to switch to edit mode, 
5. see not working but error message 'possibly access rights ... '


Actual Results:
edit mode blocked, 

Expected Results:
editing enabled after providing correct password, as in older versions, 


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.5.0.0.alpha0+ (x64)
Build ID: 873ce9b271b00e044912f4849ae2649b4fa21efd
CPU threads: 8; OS: Windows 6.1 Service Pack 1 Build 7601; UI render: default; VCL: win; 
Locale: de-DE (de_DE); UI-Language: en-US
Calc: CL
Comment 1 b. 2020-01-06 14:44:07 UTC
Created attachment 156966 [details]
error message when trying to enable editing

error message when trying to enable editing
Comment 2 b. 2020-01-06 14:45:53 UTC
Created attachment 156967 [details]
file saved with password, unable to edit in dev 6.5.0.0.a0+

file saved with password, unable to edit in dev 6.5.0.0.a0+
Comment 3 Timur 2020-01-13 17:06:01 UTC
No repro 6.4.0.1. Repro 6.5+. Regression.
Comment 4 Xisco Faulí 2020-01-21 10:08:03 UTC
I can't reproduce it in

Version: 6.5.0.0.alpha0+
Build ID: b92293b3943423324064a8513c2e114d18817179
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 5 Xisco Faulí 2020-01-21 10:11:53 UTC
Reproduced in

Version: 6.5.0.0.alpha0+ (x64)
Build ID: c7f3ac890526306804ec2bdf1256ba15a4247f13
CPU threads: 16; OS: Windows 6.3 Build 9600; UI render: default; VCL: win; 
Locale: en-GB (en_GB); UI-Language: en-US
Calc: threaded

thus, WIN only
Comment 6 Xisco Faulí 2020-01-21 11:09:26 UTC Comment hidden (obsolete)
Comment 7 Xisco Faulí 2020-01-21 11:09:46 UTC Comment hidden (obsolete)
Comment 8 Xisco Faulí 2020-01-21 11:21:27 UTC
I can't reproduce it in

Versión: 6.4.0.2 (x86)
Id. de compilación: 08d19fecdc7a2298d051e19cfdb7c35544855fc3
Subprocs. CPU: 2; SO: Windows 6.1 Service Pack 1 Build 7601; Repres. IU: predet.; VCL: win; 
Configuración regional: es-ES (es_ES); Idioma de IU: es-ES
Calc: threaded
Comment 9 Miklos Vajna 2020-01-21 11:38:25 UTC
I find it unlikely, but "never say never", one could check out exactly that commit (to see the bug) and the parent (to not see the bug) to be sure.
Comment 10 Xisco Faulí 2020-01-21 11:50:22 UTC
Not reproducible in

Version: 6.4.1.0.0+ (x64)
Build ID: 97928a862bd7e74955dbc59732be9e43f1a2d42a
CPU threads: 16; OS: Windows 6.3 Build 9600; UI render: default; VCL: win; 
Locale: en-GB (en_GB); UI-Language: en-US
Calc: threaded

either, so the only way to check whether e0f20211a8048a87b078aa4cf0f28c0c847487ad is the cause would be to revert it locally
@Mike, if i'm not mistaken, you normally develop on Windows? if so, would you mind reverting e0f20211a8048a87b078aa4cf0f28c0c847487ad to see if it's the one causing the problem ?
Comment 11 Xisco Faulí 2020-01-21 15:04:00 UTC
(In reply to Xisco Faulí from comment #7)
> This is weird.
> bibisect-win64-6.5 points me to
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=e0f20211a8048a87b078aa4cf0f28c0c847487ad which is a html import commit...
> 
> @Miklos, any idea if you commit might be related ?

I do confirm the issue was introduced by e0f20211a8048a87b078aa4cf0f28c0c847487ad
Removing 'pImpl->m_aArgs = aArgs;' from sfx2/source/doc/docfile.cxx makes the issue go away on a local build

Adding Cc: to Miklos Vajna
Comment 12 Commit Notification 2020-01-22 10:41:22 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#129829 sfx2: fix handling of password to open vs modify

It will be available in 6.5.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 13 Miklos Vajna 2020-01-22 10:42:30 UTC
Problem was master-only, so no backport.
Comment 14 Xisco Faulí 2020-01-28 10:10:36 UTC
Verified in

Version: 7.0.0.0.alpha0+ (x64)
Build ID: 8118d328285ee47556d18aab1efcd2824c1dbcf0
CPU threads: 16; OS: Windows 6.3 Build 9600; UI render: default; VCL: win; 
Locale: en-GB (en_GB); UI-Language: en-US
Calc: threaded

@Miklos, thanks for fixing this issue!!