Closed blueyed closed 9 years ago
This could work if it was restricted to a few known commands (like firefox
or chrome
) and then run them in --shell=none
mode to handle command-line arguments the same as normal.
That's a cool idea, thanks!
envoy people (https://github.com/vodik/envoy) are doing something very interesting in "Wrappers with envoy" section. It seems to me all we need is a simple bash script with the same name as the executable, and we put the bash script in the path before the original executable.
For example for transmission-gtk (bittorrent client), we add the script in /usr/local/bin directory:
$ cat /usr/local/bin/transmission-gtk
#!/bin/bash
firejail /usr/bin/transmission-gtk
In the script we need the full path (/usr/bin/transmission-gtk), otherwise we'll end up calling ourselves in a loop forever. It works today, it is integrated by default with the file manager, desktop menus and icons. You click on a torrent file and it automatically opens the bittorent client in a sandbox.
It would be useful to support symlinks to the
firejail
binary, which means that a symlinkfirefox
tofirejail
would startfirefox
, instead ofbash
.The idea comes from envoy.
This would allow you to add a symlink
firefox
to e.g.~/bin
, and it would automatically use firejail, if~/bin
is before/usr/bin
in your PATH.