Bug 40244 - FILESAVE to read-only location gives wrong error message
Summary: FILESAVE to read-only location gives wrong error message
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
(earliest affected)
Inherited From OOo
Hardware: All Linux (All)
: medium minor
Assignee: Not Assigned
: 101673 115796 144298 (view as bug list)
Depends on:
Blocks: Error-Messages Save
  Show dependency treegraph
Reported: 2011-08-19 13:30 UTC by brookembecker
Modified: 2022-12-31 15:06 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description brookembecker 2011-08-19 13:30:55 UTC
Trying to save a file to a write-only folder on an ext3 disk mounted on /media/<volume name>/ gives error message "Error saving the document <document name>: <path>/<document name> does not exist". After changing folder permissions to read+write file saves ok without any errors. The error message could be more useful.

This is LibreOffice as packaged with Ubuntu 11.04. It reports itself as:
LibreOffice 3.3.3 
OOO330m19 (Build:301)
tag libreoffice-, Ubuntu package 1:3.3.3-1ubuntu2
Comment 1 Jeffrey 2011-08-20 06:08:09 UTC
At first I thought that you meant the problem was that you could not save the file properly, which did not make sense because an unwritable file cannot be written to, but now I understand that you mean that instead of saying "Error saving... .odt does not exist", it should say "writing to a protected file" or something along that line, right?

I think this could possibly be an EasyHack.
Comment 2 brookembecker 2011-08-21 07:04:32 UTC
(In reply to comment #1)

Exactly - "Cannot write to read-only location" makes more sense than "Cannot write because file does not exist". To be clear, it was the whole directory that was read-only; there was not already an existing file of the same name.
Comment 3 noname 2011-08-21 07:58:33 UTC
Hmmmm. Difficult one. Might be that fopen() uses the mode WB+ (or RB+) instead of WB ?!
Comment 4 Björn Michaelsen 2011-12-23 12:38:30 UTC Comment hidden (obsolete)
Comment 5 Florian Reisinger 2012-08-14 13:59:40 UTC Comment hidden (obsolete)
Comment 6 Florian Reisinger 2012-08-14 14:00:50 UTC Comment hidden (obsolete)
Comment 7 Florian Reisinger 2012-08-14 14:05:34 UTC Comment hidden (obsolete)
Comment 8 Florian Reisinger 2012-08-14 14:07:35 UTC Comment hidden (obsolete)
Comment 9 sasha.libreoffice 2012-10-08 12:31:20 UTC
reproduced in 3.6.2 on Fedora 64 bit
tried to save to /opt
Comment 10 leighman 2012-10-08 17:07:29 UTC
Reported confirmed.
Comment 11 Alexandr 2014-12-31 10:52:51 UTC
Reproducible with LibreOffice 4.3.3 and 4.4.0 beta2 on Debian. I tried to save a file to a read only folder in ext4 filesystem and to a NTFS filesystem mounted read only.
Comment 12 QA Administrators 2016-01-17 20:04:26 UTC Comment hidden (obsolete)
Comment 13 Buovjaga 2018-03-07 12:10:28 UTC
*** Bug 115796 has been marked as a duplicate of this bug. ***
Comment 14 Buovjaga 2018-03-07 12:11:06 UTC
I noticed that on Windows we get a system message that is not the same as on Linux.
Windows: "You don't have permission to save in this location" etc.
Linux: "Error saving the document Untitled 1: /path/to/Untitled 1.odt does not exist."

The weird thing is, according to these the message should be different: https://bugs.launchpad.net/ubuntu/+source/openoffice.org/+bug/257421

The error text seems to be here: https://opengrok.libreoffice.org/xref/core/svtools/inc/errtxt.hrc#33

Arch Linux 64-bit
Build ID: 856c57f20f9b07c686a854e0ccbb6ee3b0ee4791
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on March 7th 2018
Comment 15 QA Administrators 2019-10-08 02:28:08 UTC Comment hidden (obsolete)
Comment 16 QA Administrators 2021-10-08 03:52:43 UTC Comment hidden (obsolete)
Comment 17 Stéphane Guillou (stragu) 2022-12-31 13:42:44 UTC
*** Bug 144298 has been marked as a duplicate of this bug. ***
Comment 18 Stéphane Guillou (stragu) 2022-12-31 15:01:48 UTC
With steps from bug 144298:

1.  mkdir /tmp/Testdir
2.  chmod -w /tmp/Testdir
3.  Attempt to save any file from LO into /tmp/Testdir/something

Repro on a recent master build:

Version: (X86_64) / LibreOffice Community
Build ID: 12e8d57e791bb1befc0716d4d02af7d1d1ccb4ae
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded
Comment 19 Stéphane Guillou (stragu) 2022-12-31 15:06:21 UTC
*** Bug 101673 has been marked as a duplicate of this bug. ***