Bug 38996

Summary: FILEOPEN: Opening a Password protected spreadsheet open as read-only
Product: LibreOffice Reporter: Julien HENRY <henryju>
Component: CalcAssignee: Kohei Yoshida <kohei>
Status: RESOLVED WORKSFORME    
Severity: normal CC: jbfaure, LibreOffice
Priority: medium    
Version: 3.4.1 release   
Hardware: Other   
OS: All   
Whiteboard: (target:3.4.5)
Crash report or crash signature: Regression By:
Attachments: Password protected xls file

Description Julien HENRY 2011-07-06 01:13:24 UTC
For me this is very similar to Bug 31824. I have an .xls file created by Ms Office and is password protected. Opening this spreadsheet with Libreoffice is always read-only.

Contrary to Bug 31824 I am not able to reproduce the issue with a password protected .xls file created with Libreoffice.

I will try to provide a sample .xls file to reproduce the issue.
Comment 1 Julien HENRY 2011-07-06 02:11:09 UTC
Created attachment 48806 [details]
Password protected xls file

In fact this is a bit tricky. In Ms Office there are several available protections. You can put a password for read access, a password for write access, and also to recommand opening read-only. I think this is this last feature that is the cause of the bug.

Steps to create the file in Ms Office 2002 :
  - create a new xls file
  - Tools -> Options -> Security
  - Set read password = test
  - Set write password = test
  - Check "Read-only advised" (translated from french so maybe not exactly the same label)

Behavior when opening file with Ms Office 2002 :
  - A dialog prompt for read password
  - A second dialog ask for write password but a "readonly" button is available
  - If you choose to enter write password, a last dialog tell you that it is advised to open readonly. You have to click "cancel" to open with write authorization.

Behavior when opening file with Libreoffice :
  - A dialog ask for password
  - Spreadsheet is opened in readonly mode with no way to switch to write mode.
Comment 2 Rainer Bielefeld Retired 2011-10-01 01:35:43 UTC
Julien HENRY
What behavior (in accordance with the LibO protection concept) would you expect?
Comment 3 Rainer Bielefeld Retired 2011-10-01 01:59:35 UTC
[Reproducible] with reporter's sample document and "LibreOffice 3.4.3 RC2 - WIN7 Home Premium (64bit) German UI [OOO340m1 (Build:302)]", the document remains write protected, no way to get write access except saving under new name as .xls without protection.

Same problem with LibO 3.3.3 Portable an Master, also with OOo 3.3
No Problem with OOo 3.1.1

Inherited from OOo 3.2?

@Kohei:
Please feel free to reassign (or reset Assignee to default) if it’s not your area or if provided information is not sufficient. Please set Status to ASSIGNED if you accept this Bug.
Comment 4 Allan Jacobs 2011-10-03 18:40:46 UTC
From bug 41282 (probable duplicate).

There is really a problem with the specification of this feature.  There are
three items in play.  A read password, a read-only check box, and a write
password.

Read-protect means that the document can be read with a password. 
Write-protect means the document can be changed with a password.  Read-only
means that the document can only be read.

The user guide says that a document for which the "Open file read-only" check
box is checked can actually be written to if the save is accompanied by a write
password.  (This user interface would have to be considered strange, if it were
actually implemented.)

If it is assumed that the user guide actually were implemented:

Read      Read-only Write
password  Checked   Password    Expected Result           Actual result
--------  --------- --------    ------------------------ ---------------
Null      Unchecked Null        Unprotected               Unprotected
Not null  Unchecked Null        Read-prot                 Read-prot
Null      Checked   Null        Read-only                 Read-only
Not null  Checked   Null        Read-prot & Read-only     Read-prot & Read-only
Null      Unchecked Not null    Reject the user input     Read-only
Not null  Unchecked Not null    Reject the user input     Read-prot & Read-only
Null      Checked   Not null    Write-prot                Read-only
Not null  Checked   Not null    Read-prot & Write-prot    Read-prot & Read-only

This, in my opinion, is what should be implemented.  The documentation should
be changed to match...

Read      Read-only Write
password  Checked   Password    Expected Result
--------  --------- --------    ------------------------
Null      Unchecked Null        Unprotected
Not null  Unchecked Null        Read-prot
Null      Checked   Null        Read-only
Not null  Checked   Null        Read-prot & Read-only
Null      Unchecked Not null    Write-prot
Not null  Unchecked Not null    Read-prot & Write-prot
Null      Checked   Not null    Read-only (write-password ignored)
Not null  Checked   Not null    Read-prot & Read-only (write-password ignored)
Comment 5 Allan Jacobs 2011-10-03 18:42:55 UTC
If bug 41282 is marked a duplicate of this one, the component for 38996 should be changed from Spreadsheet to either UI or LibreOffice.
Comment 6 Björn Michaelsen 2011-12-23 13:25:09 UTC
Since all new unconfirmed bugs start in state UNCONFIRMED now and old unconfirmed bugs were moved to NEEDINFO with a explanatory comment, all bugs promoted above those bug states to NEW and later are automatically confirmed making the CONFIRMED whiteboard status redundant. Thus it will be removed.
Comment 7 Jean-Baptiste Faure 2012-01-28 12:51:10 UTC
(In reply to comment #1)
> [...]
> Behavior when opening file with LibreOffice :
>   - A dialog ask for password
>   - Spreadsheet is opened in read-only mode with no way to switch to write mode.

It is not true in LO 3.4.5 ans LO 3.5.0 rc2+ : clic on Edit button and you are asked to provide the write password. If the password is correct, LO switches in edit mode. Verified under Ubuntu, please try it under MS-Windows.

Closing as WorksForMe. Please feel free to reopen if it does not work under MS-Windows.

Best regards. JBF
Comment 8 Rainer Bielefeld Retired 2012-12-31 10:07:05 UTC
Target info due to latest comments