Bug 144298 - Permission errors when saving mis-diagnosed (not caught?)
Summary: Permission errors when saving mis-diagnosed (not caught?)
Status: RESOLVED DUPLICATE of bug 40244
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Save
  Show dependency treegraph
 
Reported: 2021-09-04 20:00 UTC by Jim Avera
Modified: 2022-12-31 13:42 UTC (History)
1 user (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 Jim Avera 2021-09-04 20:00:04 UTC
If a Save is attempted into a directory which does not have write permission, the error appears (my guess) to be undetected, or at least not reported up to the UI.

The result is that the user is shown a confusing error over and over:

   "/path/to/readonly-directory/file.ods does not exist".

If the user clicks OK (the only choice), the error box re-appears immediately, and this repeats several times before the user is able to recover control.

My guess is that the failed save was not detected, and subsequent operations which try to read or validate the new file name fail with the above message.

At the C level, a file-create call [ open(pathname, O_CREAT|...) ] in this situation returns -1 and sets ERRNO to 13 ("Permission denied").   But this error
is not making it to the user.

STEPS TO REPRODUCE:

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

RESULTS:  Stuck (for several iterations) at the "does not exist" message

EXPECTED RESULTS: "Permission denied" or similar, once only, allowing the user to take corrective action.
Comment 1 Jim Avera 2021-09-04 20:35:01 UTC
Also, after clicking through all the "does not exist" errors, the following appears on the terminal:

warn:sfx.control:92170:92170:sfx2/source/control/dispatch.cxx:1206: Childwindow slot missing: 25917
warn:sfx.control:92170:92170:sfx2/source/control/dispatch.cxx:1206: Childwindow slot missing: 25917
warn:legacy.osl:92170:92170:sc/source/ui/view/tabvwshh.cxx:232: no accessibility broadcaster?
Comment 2 Stéphane Guillou (stragu) 2022-12-31 13:37:27 UTC
Reproduced in recent master build:

Version: 7.6.0.0.alpha0+ (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

Twice the "does not exist" message, with a final "The file could not be written".

In the console:

warn:sfx.dialog:68561:68561:sfx2/source/dialog/filedlghelper.cxx:1688: stat(/tmp/Testdir/Untitled 1) failed with errno 2
warn:sfx.doc:68561:68561:sfx2/source/doc/objstor.cxx:1352: SfxObjectShell::SaveTo_Impl: very early error return
warn:sal.file:68561:68561:sal/osl/unx/file_misc.cxx:674: Invalid file URL
warn:sfx.doc:68561:68561:sfx2/source/doc/objserv.cxx:1078: Fatal IO error during save com.sun.star.task.ErrorCodeIOException message: "SfxBaseModel::impl_store <file:///tmp/Testdir/Untitled%201.odt> failed: 0xc10(Error Area:Io Class:Write Code:16) at /home/tdf/lode/jenkins/workspace/lo_gerrit/tb/src_master/sfx2/source/doc/sfxbasemodel.cxx:3215" errcode: 3088

In OOo 3.3, the message was already "does not exist", but only once.

OpenOffice.org 3.3.0
OOO330m20 (Build:9567)
Comment 3 Stéphane Guillou (stragu) 2022-12-31 13:42:44 UTC

*** This bug has been marked as a duplicate of bug 40244 ***