SUMMARY every time i try to save a file out of Okular to a folder in my home-directory, i get the reply "Datei kann nicht in „/tmp/okular.Lufxxf“ gespeichert werden." (file can't save in /tmp/okular.Lufxxf). Out of other applications i can save files without any problem. STEPS TO REPRODUCE 1. I choose menue |file|save| (or |save as|) and select a sub folder in my home directory 2. When I confirm to save the file, i get the reply, that i can't save in /tmp/... 3. OBSERVED RESULT It is not possible to save any file from okular. EXPECTED RESULT SOFTWARE/OS VERSIONS Linux/KDE Plasma: KDE Plasma Version: 5.18.6 KDE Frameworks Version: 5.71.0 Qt Version: 5.12.7 OS: Opensuse Leap 15.2 ADDITIONAL INFORMATION
*** This bug has been marked as a duplicate of bug 402017 ***
Why is this a duplicate of bug 402017? This bug report describes that Okular attempts to save in a wrong place. Bug 402017 describes that Okular attempts to read a file from a not existing place. The given example is /tmp/okular.Lufxxf, which does not look like the user opened a file from e. g. KMail, because the filename contains “okular”, not “kmail”. @Joerg: Can you describe how you opened the file?
(In reply to David Hurka from comment #2) > Why is this a duplicate of bug 402017? Because the above-mentioned file names are typical for the browser-opened PDFs.
(In reply to David Hurka from comment #2) > Why is this a duplicate of bug 402017? > > This bug report describes that Okular attempts to save in a wrong place. Bug > 402017 describes that Okular attempts to read a file from a not existing > place. > > The given example is /tmp/okular.Lufxxf, which does not look like the user > opened a file from e. g. KMail, because the filename contains “okular”, not > “kmail”. > > @Joerg: Can you describe how you opened the file? @David: thanks for your reply. I agree with you. It's the same result, whether I open a local file and try to save it or i try to save a browser-opend file. Both don't work and i'm asked to choose another directory than /tmp/..., although i selected a folder in my home-directory.
Change the status for further investigation (cannot reproduce it btw).
An other problem with Okular occured today. I can't print from Okular. To get an error-report, i started Okular from console. When i tried to print, the reply on console was "/usr/bin/lpr: Fehler - Zugriff auf »/tmp/okular_IhOqaH.ps« nicht möglich - Keine Berechtigung" witch means: no access to /tmp ... - no authorization.
This really smells like your system is broken/badly configured.
(In reply to Albert Astals Cid from comment #7) > This really smells like your system is broken/badly configured. I don't think so, because only okular shows the problems mentioned above. Other applications work without any problems.
You're not authorized to write to /tmp, sorry but that means your system is broken.
(In reply to Albert Astals Cid from comment #9) > You're not authorized to write to /tmp, sorry but that means your system is > broken. That's not the reason for my problem. I can write to /tmp (I just tested it and saved a file out of kate in /tmp). In the directory access control owner and group are set to root, all others are allowed to read and change. Only okular has some kind of problem with it. Anyway, I don't want to save in /tmp, when I try to save out of okular (I select my home directory), but okular complains, that it can't save to /tmp.
The very same thing happened to me today. It happened to me several times in the past, but today I decided to google about this issue more and found this bug report. This ticket describes the bug very well. What lead to the issue in my case: STEPS TO REPRODUCE 1. Open a PDF file in Okular 2. Make annotations, then press "Save" button. 3. Make annotations, add text with the type tool, then press "Save" button. 4. Repeat steps 2 and 3, keep doing modifications and then save the file. After some time you will run into the bug. OBSERVED RESULT When pressing the "Save" button an error is shown: "File could not be saved in '/tmp/okular.bvEIkY'. Try to save it to another location." The "Save As..." button also does not work, the file cannot be saved to any other location (for example, any folder in my home folder). As a work-around, to not loose an hour of work I had to print into PDF, that works but it is far from the ideal solution. EXPECTED RESULT File is saved, no data loss.
This may be relevant: The issue happens to me only when I open files from a CIFS mount. If I copy over the file to my local home directory it never crashes. Maybe Okular uses the tmp files when opening from a CIFS file system?
Same here: Pdf opened from samba share, after annotating 2-3 times, save/save as fail (file can't save in /tmp/okular.xyz). Same pdf opened from the local file system, after annotation 2-3 times, save/save as work as expected. Archlinux, i3wm, Okular version 24.05.1
For when someone has time, please explain exactly how to setup that scenario you're describing, knowing about developing okular is a totally different skill to knowing what CIFS is or how to set it up.
(In reply to Albert Astals Cid from comment #14) Hi, first of all thanks your code care efforts, cifs means a samba share, where files are offered within a network for a plenty of users. I suggest you set up a virtual machine for it, for example an Ubuntu Server 20.04 LTS. Samba setup on the server: sudo apt install samba sudo adduser --no-create-home --disabled-login --shell /bin/false testuser sudo smbpasswd -a testuser sudo mkdir /srv/data/all sudo vim /etc/samba/smb.cnf ... workgroup = team ... [testusershare] comment = Testuser Directories path = /srv/data/all browsable = yes read only = no create mask = 0770 force create mode = 0770 directory mask = 0770 force directory mode = 0770 inherit permissions = yes inherit acls = yes sudo systemctl restart smbd On the client side, i. e. a current Ubuntu: sudo mkdir /media/testusershare sudo apt install cifs-utils vim /home/<localuser>/.smbcredentials username=testuser password=<secret> chmod 600 /home/<localuser>/.smbcredentials vim /etc/fstab ... //<IP virtual server>/testusershare /media/testusershare cifs credentials=/home/<localuser>/.smbcredentials, uid=<uid localuser>,gid=<gid localuser>,vers=3.1.1,nobrl 0 0 ... sudo mount -a Voilà, then you should be able to save pdf files on /media/testusershare for testing purpose. Regards, dm
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.
Created attachment 180144 [details] Picture of saving it Can confirm, editing a file via sftp://[user]@[ip]/srv/[routetofile] and saving it, it saves into this route: Soft locks okular, and you have to unlock it by using some hotkey, for example Ctrl+o(opening a file) opens a prompt, after closing the prompt, Okular its responsive again