Firejail: File saves in different directory than selected
-
Here is a strange behavior when running Vivaldi in Firejail. (It's probably a firejail profile issue.)
Vivaldi version: 6.8.3381.48 (Stable channel) stable (64-bit) on manjaro linux
Firejail version 0.9.72Starting Vivaldi with the following command:
firejail --profile=/etc/firejail/vivaldi.profile --net=ovpnbridge --dns=192.168.38.1 --private=${HOME}/jail /usr/bin/vivaldiGo to a website
Right click on a link -> save as
A dialog opens, showing the folder structure of ${HOME} (should have been ${HOME}/jail )
Select Downloads folder
Save.Now, if I look in ${HOME}/Downloads, the file is not there. But if I look in ${HOME}/jail a folder named Downloads is created and the file is there.
The same thing happens when I save an attachment in mail.
Even more interesting is to open a file, either for view or to send as attachment.
Say you want to open the file ${HOME}/jail/sendme.txt
Click open... the file isn't there because you see ${HOME}. Browse to folder jail. There is the file. Open it.... It does not exist. Because Vivaldi is now trying to open ${HOME}/jail/jail/sendme.txt, which doesn't exist.
The workaround is to create a copy of the file, either in ${HOME} or in ${HOME}/jail/jail. Then, when you select the file, Vivaldi will open the copy!I'm quite sure this is a firejail default profile issue. Does anyone have an idea of what to change?
Firefox, which shares quite a bit of the same settings does not have any such issues. -
@marlinus The more interesting question is whether it happens on regular Chrome too. I would guess this is a Chromium issue. You might get more insights by searching the web for Chromium/Firejail bugs. Vivaldi’s stance on Firejail is this ☛ https://forum.vivaldi.net/post/668310
-
I think it is somewhat related to this bug:
https://github.com/netblue30/firejail/issues/5032
It's two years old, and still open. That's strange. I'd expect Chromium to be widely used.
I tried the suggested solutions - most of them was actually already put into the profile files.
Most of them did not change anything, while the noroot option caused the file dialog to not open at all.I think I've found a solution though.
I collected all config lines from firefox.profile with all it's includes
Did the same with vivaldi.profile and all includes.
Then compared the two to find what was in firefox that was not in vivaldi.
From that result I removed all lines containing the words 'firefox' or 'mozilla'.
This result I put into vivaldi.local
Then I got a working file dialog!
Then I removed the line one by one until it was no longer working.
The result was one line that seemed to fix the issue:dbus-user filter
One downside seems to be that Vivaldi turned extremely slow at loading the first page after startup. It kind of feels like it is waiting for DNS request to time out. Then it retries, and it works. But this also happens if you are loading a domain name that is in /etc/hosts. Hence it cannot be DNS related.
However this introduces a new issue.... Vivaldi does no longer accept certificates installed by certutil.
That was solved (workaround) by copy ${HOME}/.pki/nssdb into ${HOME}/jail-test/.pki.Better would probably be to whitelist the .pki folder.
Now, I did this on a test jail. A folder that was blank when I started.
Changing this to a jail that has been used before triggers a warning about data loss (passwords, mail, ...)I chose continue with dataloss. All mail was there, but stored passwords had to be reentered.
Now, the delay before first url load seems to be gone as well. I have no clue what fixed that. Maybe the existence of the nssdb/* files?
Anyway. All seems to work. But there are errors thrown to terminal (when run from terminal) looking like this
(vivaldi:10): dconf-WARNING **: 23:01:37.562: failed to commit changes to dconf: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: org.freedesktop.DBus.Error.ServiceUnknown
every time I browse to a folder in the file dialog.
Upload works. Download works. Folder structure in file dialog is correct.