I am not sure whether it's a bug or I just miss something, that's why I'm posting my support request here before filing a bug on Launchpad.
I am using Whatsdesk to manage my Whatsapp account. Something weird happens when I try to save some PDF from a chat to my /tmp folder: the files are originally named Modello Time Sheet - Arianna Tramici .pdf and relazione finale - Arianna Tramici .pdf but it also happens if I save any of those as AAA.pdf leading me to think the name should not be the issue.
Those seem to be correctly saved, but I cannot find them there: either via Caja or via terminal. I suppose they are saved somehow because when I try to save them again in /tmp I am asked whether to overwrite the existing copies. On the other hand, I can see those files correctly both via Caja and terminal when I save them on my desktop folder (see screenshot, I just saved one of those for example on my desktop).
Via command line, it does not work either when I run sudo ls -la or ls -la after running su .
Also, I cannot find them if I open Caja via sudo or via su. This issue does not happen when I use Whatsapp Web via browser: I can see the files wherever I saved them.
The screenshot show what I see when I save the files via Whatsdesk and when I try to find them via Caja. One more detail: I see that Whatsdesk is run as normal user, just as any other application launched though the desktop menu, as well as the firefox browser used to run Whatsapp Web.
I think it also happened a similar thing sometime recently when I was using Linux Mint with Nemo. I only know it wasn't with Whatsdesk because I'm using it now for the first time, but cannot remember what application I was using when that similar issue happened: then I just thought I was too tired to realize where I saved my files...
Unfortunately, the location is correct. However, I removed that bookmark, tried to save one of the files again, but the problem persists. In detail, I saved one of those files as NEWTEST.pdf in the /tmp folder navigating it "manually", but I cannot see it via Caja/terminal. In fact, I have already tried to do it that way, but I did not describe it in the previous post, trying not to make it longer and longer.
What I see it that Whatsdesk shows just another content for the /tmp folder, showing different as well as fewer files than the /tmp folder shown via Caja/terminal. This does not happen with the desktop folder: the files shown via Whatsdesk are exactly the same I can see via Caja/terminal.
The location I told Whatsdesk to save to is /tmp, at least that's what I supposed I was doing when browsing the file system though the Whatsdesk window, going from the / directory to its subfolder tmp. By the way, "Segnalibri" is the Italian name for "bookmarks" and yes, it was set to /tmp taking into account it did not work either when reaching /tmp without using the bookmark.
However, I think I have just found the issue. I don't know why, the Whatsdesk "save" window shows exactly the same content of the file system just as shown by the terminal or Caja, except for the /tmp folder which, in turn, corresponds to /tmp/snap.whatsdesk/tmp which is where I can find all the files I try to download to /tmp selected via Whatsdesk. I cannot access the /tmp/snap.whatsdesk/tmp folder as normal user while it is accessible via terminal after running the su command or via Caja after running sudo caja. I redrwxrwxrwt 4 root root 4096 lug 16 13:33 tmpmark that the strange thing is that the file system corresponds on all the other folders!
Just some further details:
Double clicking on the Whatsdesk application runs the following command env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/whatsdesk_whatsdesk.desktop /snap/bin/whatsdesk %U
The issue persists when I run whatsdesk from terminal too, without all that stuff included in the above command.
Saw snapd in your screenshot, I'm outa here, but would suggest if using a snap version search on snap file permissions may be blocking access? Have seen issues but had no interest in topics.
Also try suggestion by @pavlos_kairis and see if they save to your local files which I think is a better location. I myself send everything to Desktop and when finished put them where I want.
Last but not the least, how the @pavlos_kairis suggestion can help me, considering that I do see the downloaded files easily when I save them everywhere but in /tmp ?
OK have the app send file (name it D) to your Desktop and file (name it t) to your /tmp.
Exit app.
Open Caja
navigate to /tmp.
Is file t there?
Now drag file D to /tmp
If this works it would seem like the snap can't write to that location.
Still don't see attraction to saving to /tmp and not /home you end up moving the file anyway.
Slim chance since you seem to indicate it is immediately not visible.
On my system there is a cron job that I think cleans the tmp.
In terminal type systemctl list-timers
Note: will not match your list as I have some items masked.
In your /home/user_name search for snap and see it your files might be there.
Thanks again for your feedback. However, please let me clarify that my aim is NOT downloading to /tmp in order to move those files afterwards from /tmp to other folders. Normally, I download to /tmp everything I do not need to keep on my PC: I just use those files after downloading to /tmp then I let those files die there and be deleted automatically when I restart the PC, just not to leave garbage files around.
That said, as mentioned before, I cannot find any file in /tmp when I save them there via WhatsDesk. Let me explain shortly the issue again. When I download files to /tmp via WhatsDesk they are actually saved to /tmp/snap.whatsdesk/**tmp** and not in /tmp despite the save window makes me think they are going to be saved in /tmp.
In fact, as shown before, I cannot find those files in /tmp (as shown by the save window of WhatsDesk) but in /tmp/snap.whatsdesk/**tmp** (as shown by Teminal or Caja).
In conclusion, I specify that I mentioned the other folders just to show that when I save via WhatsDesk something elsewhere (not in /tmp) the files are saved correctly, I mean I can find them in that location as expected.
So, the question is: why those files are saved to /tmp/snap.whatsdesk/**tmp** via WhatsDesk and not in /tmp? In other words, how can I save those files in /tmp via WhatsDesk?
Hope it is clearer now.
Thanks.
Regards.
(...)
4. Sets up a private /tmp directory using a per-snap private mount namespace and mounting a per-snap directory on /tmp.
(...)
The above paragraph explains why your "WhatsDesk" snap application "sees" the "/tmp/snap.whatsdesk/tmp" folder as if it was the proper "/tmp"
I believe this is set up like that due to the "restrictive security sandbox" philosophy that is presented in the first paragraph of that same web page:
Without custom flags at installation, or subsequent interface connections, snaps are confined to a restrictive security sandbox with no access to system resources outside of the snap. (...)