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


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.

 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


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. edit retag close merge delete ## Comments 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? ( 2021-03-04 07:52:18 +0200 )edit @ajlittoz I have updated the question. Thank you. ( 2021-03-04 15:17:13 +0200 )edit „I set a file as read only using UNIX permissions.” If set to read-only on UNIX, no application will be able to write to the file. You can open such a file, you can change the content, but when you try to save you will always be informed that it is impossible. ( 2021-03-04 19:21:11 +0200 )edit @Astur I have updated the question with information that I hope will clarify the issue. Do you see where my understanding is incorrect. ( 2021-03-04 21:55:57 +0200 )edit 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. ( 2021-03-04 22:40:55 +0200 )edit @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.

( 2021-03-04 22:52:03 +0200 )edit

Same as yours.

( 2021-03-04 23:23:50 +0200 )edit

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)?

( 2021-03-05 07:29:31 +0200 )edit

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

( 2021-03-05 16:38:53 +0200 )edit

Sort by » oldest newest most voted

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.

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.

more

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

( 2021-03-04 16:49:15 +0200 )edit

( 2021-03-04 19:22:51 +0200 )edit

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.

( 2021-03-04 21:16:37 +0200 )edit

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

( 2021-03-04 21:57:05 +0200 )edit

You probably didn't do anything. In LibreOffice, a read-only file may or may not be password-protected. This can be set in File => Properties… => Security => Open file read-only. LibreOffice recognizes that you are the creator of this read-only file. If so, and the file is in Startcenter, you can open it without restriction. However, if you open the same file with Open File, the restrictions will appear and remain. Note that if you haven't set a security password, you won't unlock this file anymore.

more