https://bugs.kde.org/show_bug.cgi?id=432271

John B <john+kde_...@daaave.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john+kde_...@daaave.org

--- Comment #16 from John B <john+kde_...@daaave.org> ---
I'm encountering this issue as well; it's an older version of Okular (1.9.3)
but the symptoms seem pretty similar and I've got some extra context that might
be helpful; for me, the issue is (so far, unfortunately) 100% reproducible.

I have a PDF with forms that I downloaded from the Internet (specifically, an
MS Teams DM but the relevancy there seems like a real stretch, heh), saved to
my home directory (first to `~/Downloads`, and then relocated to `~` directly
just to see if it would help as a workaround), and then opened as a local file
with Okular.  In both cases, neither "Save" nor "Save As..." works (they both
give the same error about not being able to write to `/tmp/okular.*`,
regardless of the destination directory I actually select.

Here's the interesting bit: I looked at the file in question (the suffix
changes every time) and that file _is_ getting created in `/tmp` (the parent
`/tmp` directory has mode `1777` AKA `drwxrwxrwt`) BUT it's being given mode
`0` itself and is empty.  So, that's why the write error: the `okular` process
has write permissions to `/tmp`, so it can create the empty file, but it has no
write permissions _to the file itself_ so it can't actually save. 
Theoretically if one could beat the race condition, one could fix the mode on
`/tmp/okular.xxxxx` before it tries to write the PDF data...any theories on how
to accomplish that are welcome.

Just as a "visual aid", this is what it looks like if you list the files in
question while the alert dialog is open (Okular will delete the temp file as
soon as you click OK):

```
% ls -ld /tmp /tmp/okular.*
drwxrwxrwt 58 root root 12288 Apr  4 15:05 /tmp
----------  0 john john     0 Apr  4 15:05 /tmp/okular.hfaxHW
```

I checked my umask value just as a precaution, but it's `077` as expected. 
Besides, it doesn't look like that's it:

```
% umask
077
% grep '^Umask:' /proc/$(pgrep okular)/status
Umask:  0077
```

I can't even print the PDF to PDF because the temp file for that
(`/tmp/okular_eDMEMB.ps` in this case) is also being created with `0`
permissions, so the GhostScript conversion fails.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to