Bug 41282 - Password protection for writes is implemented as read-only.
Summary: Password protection for writes is implemented as read-only.
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.4.3 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Cédric Bosdonnat
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-27 22:03 UTC by Allan Jacobs
Modified: 2013-06-19 08:24 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Jacobs 2011-09-27 22:03:46 UTC
This is a variant of bug 38996.

There are a lot of different combinations of options to try.  There are no workarounds.  Any attempt to allow changes to a document subject to knowledge of a password fails -- the document is stored read-only.

File->New
Enter some text.
Save As
Name: Unprotected
ODF Text Document (.odt)
Save
File->Close

Open Unprotected.odt
File->Save As
Name: ReadOnly
ODF Text Document (.odt)
Save with password (check)
Save
More Options
Open file read-only (check)
OK
File->Close
Open ReadOnly.odt
Try editing.  ReadOnly.odt really is read only.
File->Close

Open Unprotected.odt
File->Save As
Name: WritePassword
ODF Text Document (.odt)
Save with password (check)
Save
More Options
Enter password to allow editing: p
OK
File->Close
Open WritePassword.odt
Try editing.  WritePassword.odt is read only.
File->Close

Open Unprotected.odt
File->Save As
Name: ReadOnlyWritePassword
ODF Text Document (.odt)
Save
Save with password (check)
More Options
Open file read-only (check)
Enter password to allow editing: p
OK
File->Close
Open ReadOnlyWritePassword.odt
Try editing.  ReadOnlyWritePassword.odt is read only.
File->Close

Open Unprotected.odt
File->Save As
Name: TwoPassword
ODF Text Document (.odt)
Save with password (check)
Save
Enter password to open: p
More Options
Enter password to allow editing: q
OK
File->Close
Open TwoPassword.odt
Try editing.  TwoPassword.odt is read only.
File->Close

Open Unprotected.odt
File->Save As
Name: ReadOnlyTwoPassword
ODF Text Document (.odt)
Save with password (check)
Save
Enter password to open: p
More Options
Open file read-only (check)
Enter password to allow editing: q
OK
File->Close
Open ReadOnlyTwoPassword.odt
Try editing.  ReadOnlyTwoPassword.odt is read only.
File->Close

Open Unprotected.odt
File->Save As
Name: SharedPassword
ODF Text Document (.odt)
Save with password (check)
Save
Enter password to open: p
More Options
Enter password to allow editing: p
OK
File->Close
Open SharedPassword.odt
Try editing.  SharedPassword.odt is read only.
File->Close

Open Unprotected.odt
File->Save As
Name: ReadOnlySharedPassword
ODF Text Document (.odt)
Save with password (check)
Save
Enter password to open: p
More Options
Open file read-only (check)
Enter password to allow editing: p
OK
File->Close
Open ReadOnlySharedPassword.odt
Try editing.  ReadOnlySharedPassword.odt is read only.
File->Close
Comment 1 Rainer Bielefeld Retired 2011-10-01 01:41:07 UTC
@Reporter:
please:
- add information 
  -- what exactly is unexpected
  -- and why do you believe it's unexpected (cite Help or Documentation!)
Comment 2 Allan Jacobs 2011-10-03 17:10:35 UTC
http://www.libreoffice.org/get-help/documentation/

In the Writer guide, Chapter: Chapter 1 Introducing Writer, Section: Password protection.

"Writer provides two levels of document protection: read-protect (file cannot be viewed without a password) and write-protect (file can be viewed in read-only mode but cannot be changed without a password). Thus you can make the content available for reading by a selected group of people and for reading and editing by a different group."

"Here you have several choices:
• To read-protect the document, type a password in the two fields at the top of the dialog box.
• To write-protect the document, click the More Options button and select the Open file read-only checkbox.
• To write-protect the document but allow selected people to edit it, select the Open file read-only checkbox and type a password in the two boxes at the bottom of the dialog box."

The bug is that the third of these choices is unavailable.  The different combinations demonstrate that the third of these choices was not, in fact, implemented (it could have been implemented and not match the documentation).
Comment 3 Allan Jacobs 2011-10-03 17:47:10 UTC
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 4 Allan Jacobs 2011-10-03 18:39:36 UTC
The behavior is identical to bug 38996, now in Accepted state.  Assuming that this is because there is shared code, I recommend closing 41282 as a duplicate and changing the component of 38996 to either LibreOffice or UI.
Comment 5 Rainer Bielefeld Retired 2011-10-03 22:53:50 UTC
@Allan Jacobs:
Your assumption sounds very plausible, but I believe developers should decide concerning DUP.

@Cédric:
Please check comment 4!
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 6 afunkebr 2012-03-27 17:33:03 UTC
I believe one needs to click the "Edit File" icon after opening the "write-password protected" document (a password is required for editing) so that LO prompts you for the password and leaves the ReadOnly mode.

Actual steps (partial quote from Description) should be:

(extra steps marked by "==>")

Open Unprotected.odt
File->Save As
Name: WritePassword
ODF Text Document (.odt)
Save with password (check)
Save
More Options
Enter password to allow editing: p
OK
File->Close
Open WritePassword.odt
==> Click on the "Edit File" icon.
==> A pop-up dialog opens requesting for the edit password.
==> Type the correct password for editing the file
==> File leaves readonly mode and can now be edited.
Comment 7 ign_christian 2013-06-19 08:24:41 UTC
WORKSFORME per comment 6, also confirm not reproducible on LO 4.0.4.2 (Win7 32bit)