writer writing read-only

OS Ubuntu 20.04

 Version: 6.4.6.2
  Build ID: 1:6.4.6-0ubuntu0.20.04.1
  CPU threads: 8; OS: Linux 5.8; UI render: default; VCL: gtk3; 
  Locale: en-US (en_CA.UTF-8); UI-Language: en-US
  Calc: threaded

I set a file as read only using UNIX permissions.

When I open this read-only file in Writer, I can modify the document and save the changes without warning.

It hasn’t always been this way. I have been warned about Read Only mode. When this happens I cannot put the cursor into writing mode. This is how it should be.

After some interesting comments I am adding some additional information :

Additional information

 stephen@asus:~/winter-romance$ ll | grep 360.1
 -r--r--r-- 1 stephen stephen  31K 2021-03-04 12:41 360.1.SnowStormOnTheMillerRoad.odt
 stephen@asus:~/winter-romance$ sha1sum 360.1.SnowStormOnTheMillerRoad.odt 
 c2ec420ad587a27df0ce44c711d0642997d98511  360.1.SnowStormOnTheMillerRoad.odt

Note the file has no write permissions

I then load the file in Writer, make a change, and save the file.

stephen@asus:~/winter-romance$ ll 360.1.SnowStormOnTheMillerRoad.odt 
-r--r--r-- 1 stephen stephen 31K 2021-03-04 12:41 360.1.SnowStormOnTheMillerRoad.odt
stephen@asus:~/winter-romance$ ll 360.1.SnowStormOnTheMillerRoad.odt 
-r--r--r-- 1 stephen stephen 31K 2021-03-04 12:44 360.1.SnowStormOnTheMillerRoad.odt
stephen@asus:~/winter-romance$ sha1sum 360.1.SnowStormOnTheMillerRoad.odt 
fe92a76f365f628dd7041932ebf5bf6a6e480903  360.1.SnowStormOnTheMillerRoad.odt

Note that the modified date on the file has changed and the checksum has changed, but the permissions are not changed.

I guess I don’t understand permissions or I am setting them incorrectly. After years that comes as a surprise, but Linux can be a sly and subtle creature so…

I would very much appreciate be educated on this topic.

At a minimum, mention your OS name and LO version. Have you updated recently? How do you tell the document is read-only? OS permissions or LO warning?

@ajlittoz I have updated the question. Thank you.

@Astur I have updated the question with information that I hope will clarify the issue. Do you see where my understanding is incorrect.

Please tell us exactly how you set the file to be read-only. I did it in the following way: navigate to the folder holding the file with the Linux file manager. Right-click on the file, select Properties, select Permissions tab, set it to read-only for 1. myself, 2. everybody in the group with me and 3. everybody else. Close the dialog box (why can’t you close it with OK when you change something important there?) After that I can’t edit the file, or when I enable editing, can’t save the file with the same name.

@floris $ chmod -w <filename> If you list your file in a terminal, what permissions does it show. For me, I see -r--r--r-- 1 stephen stephen 31K 2021-03-04 12:41 360.1.SnowStormOnTheMillerRoad.odt Note that there is no ‘w’ in the permissions. With those permissions not even root can modify the file without forcing an override.

Same as yours.

I would say, this is something very serious in your OS. By the way, what filesystem do you use? I’d suggest at least check the integrity of the filesystem. As not an expert in Linux, if I had such an issue, I’d personally just reformat and reinstall everything from scratch. I highly doubt it’s a LibreOffice issue.

By the way, do other programs fail to write to those files? e.g., if you do things like echo foo > filename (using a copy of the file, of course, to not destroy your data)?

@mikekaganski No other applications can modify the file. However I will take the issue to the Ubuntu forums. Thanks.

You probably didn’t set the permissions correctly.

I opened a read-only Writer document and I get the usual Writer warning about read-only. I pressed on the Edit document button. I was then able to modify it. However when I press Ctrl+S, a dialog opens to request another name. I didn’t change it and Writer returned an error about insufficient user rights.

Check your OS permissions.

Here: LO 7.0.4.2, Fedora 33, KDE Plasma desktop

To show the community your question has been answered, click the ✓ next to the correct answer, and “upvote” by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

In case you need clarification, edit your question (not an answer which is reserved for solutions) or comment the relevant answer.

Indeed. LibreOffice is not that magically powerful to overwrite files that are protected by OS on the filesystem level.

No, admin privileges will not change this. If your user or your group has no write access to the file, the operation will be denied. LibreOffice will be unable to save. Of course, admin can use other tools to change own permissions, but that’s outside of LibreOffice functions.

@mikekaganski
I have added some information to the question. Can you see where my understanding is off?