[GH-ISSUE #553] bug with private-bin and /usr/local/bin #389

Closed
opened 2026-05-05 05:45:11 -06:00 by gitea-mirror · 11 comments
Owner

Originally created by @nick75e on GitHub (Jun 2, 2016).
Original GitHub issue: https://github.com/netblue30/firejail/issues/553

Hi!

With previous versions, when I wanted to sandbox gthumb with private-bin, I would create a file in /usr/local/bin/ to make it work system-wide but now with v0.9.40, it doesn't work any more.
It says: execvp: No such file or directory
I think it comes from the fact that firejail now also modifies /usr/local/bin/ whereas it was left untouched before. I can make firefox work because /usr/bin/firefox is a symlink, I just have to point to the real file.

Originally created by @nick75e on GitHub (Jun 2, 2016). Original GitHub issue: https://github.com/netblue30/firejail/issues/553 Hi! With previous versions, when I wanted to sandbox gthumb with `private-bin`, I would create a file in `/usr/local/bin/` to make it work system-wide but now with v0.9.40, it doesn't work any more. It says: `execvp: No such file or directory` I think it comes from the fact that firejail now also modifies `/usr/local/bin/` whereas it was left untouched before. I can make firefox work because `/usr/bin/firefox` is a symlink, I just have to point to the real file.
gitea-mirror 2026-05-05 05:45:11 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@netblue30 commented on GitHub (Jun 2, 2016):

Yes, it is a bug. Adding /usr/local/bin to private-bil list is breaking firejail symbolic links in /usr/local/bin. I'll bring in a fix shortly, thank you for the bug.

<!-- gh-comment-id:223296579 --> @netblue30 commented on GitHub (Jun 2, 2016): Yes, it is a bug. Adding /usr/local/bin to private-bil list is breaking firejail symbolic links in /usr/local/bin. I'll bring in a fix shortly, thank you for the bug.
Author
Owner

@netblue30 commented on GitHub (Jun 3, 2016):

Fixed!

<!-- gh-comment-id:223583083 --> @netblue30 commented on GitHub (Jun 3, 2016): Fixed!
Author
Owner

@nick75e commented on GitHub (Jun 3, 2016):

Thanks for the fast fix.
I tried to compile but the files are not in the same directories as with the .deb file.
How can I make the compiling process work like the .deb file?

<!-- gh-comment-id:223591310 --> @nick75e commented on GitHub (Jun 3, 2016): Thanks for the fast fix. I tried to compile but the files are not in the same directories as with the .deb file. How can I make the compiling process work like the .deb file?
Author
Owner

@netblue30 commented on GitHub (Jun 4, 2016):

Do your git clone, go into firejail directory followed by "./configure --prefix=/usr", then do a "make deb". When is done, you have a new deb file in firejail directory.

<!-- gh-comment-id:223751583 --> @netblue30 commented on GitHub (Jun 4, 2016): Do your git clone, go into firejail directory followed by "./configure --prefix=/usr", then do a "make deb". When is done, you have a new deb file in firejail directory.
Author
Owner

@nick75e commented on GitHub (Jun 4, 2016):

The fix doesn't work, I still get execvp: No such file or directory. :-(

<!-- gh-comment-id:223754083 --> @nick75e commented on GitHub (Jun 4, 2016): The fix doesn't work, I still get `execvp: No such file or directory`. :-(
Author
Owner

@netblue30 commented on GitHub (Jun 4, 2016):

Give me some more data. How are you starting it?

<!-- gh-comment-id:223762982 --> @netblue30 commented on GitHub (Jun 4, 2016): Give me some more data. How are you starting it?
Author
Owner

@nick75e commented on GitHub (Jun 4, 2016):

here's how to reproduce:

sudo echo "firejail /usr/bin/gthumb" > /usr/local/bin/gthumb
sudo chmod +x /usr/local/bin/gthumb
gthumb
  • up to v0.9.38: OK
  • v0.9.40: execvp: No such file or directory

Note1: /usr/bin/gthumb is a binary not a symlink.
Note2: It occurs with any program that isn't a symlink in $PATH

<!-- gh-comment-id:223763379 --> @nick75e commented on GitHub (Jun 4, 2016): here's how to reproduce: ``` sudo echo "firejail /usr/bin/gthumb" > /usr/local/bin/gthumb sudo chmod +x /usr/local/bin/gthumb gthumb ``` - up to v0.9.38: OK - v0.9.40: `execvp: No such file or directory` Note1: `/usr/bin/gthumb` is a binary not a symlink. Note2: It occurs with any program that isn't a symlink in $PATH
Author
Owner

@netblue30 commented on GitHub (Jun 5, 2016):

It looks like I've fixed a different problem! Instead of "firejail /usr/bin/gthumb" put "firejail --debug /usr/bin/gthumb", run it from a terminal and put output here. Also, what do you have in the profile?

<!-- gh-comment-id:223817604 --> @netblue30 commented on GitHub (Jun 5, 2016): It looks like I've fixed a different problem! Instead of "firejail /usr/bin/gthumb" put "firejail --debug /usr/bin/gthumb", run it from a terminal and put output here. Also, what do you have in the profile?
Author
Owner

@nick75e commented on GitHub (Jun 5, 2016):

Here you are:
Output
gthumb.profile
block.inc
common_bin.inc

<!-- gh-comment-id:223822981 --> @nick75e commented on GitHub (Jun 5, 2016): Here you are: [Output](https://gist.github.com/nick75e/5f4db369b93c5e30fa45881c4f18af0d) [gthumb.profile](https://gist.github.com/nick75e/fc0abad001f332eceefa57670e895a85) [block.inc](https://gist.github.com/nick75e/1a144ac49488ebcaf58c7f3093694bcb) [common_bin.inc](https://gist.github.com/nick75e/56daf869038730484c4f7f6fe84746c2)
Author
Owner

@netblue30 commented on GitHub (Jun 6, 2016):

Make /usr/local/bin/gthumb a symbolic link to /usr/bin/firejail instead of a bash script. --private-bin grabs only the first file in the path, so your script ends up starting itself.

You need the development version 0.9.41, it has the original fix for firejail symbolic links. Then, you remove the script and add the symlink instead:

$ sudo rm /usr/local/bin/gthumb 
$ sudo ln -s /usr/bin/firejail /usr/local/bin/gthumb
<!-- gh-comment-id:223995520 --> @netblue30 commented on GitHub (Jun 6, 2016): Make /usr/local/bin/gthumb a symbolic link to /usr/bin/firejail instead of a bash script. --private-bin grabs only the first file in the path, so your script ends up starting itself. You need the development version 0.9.41, it has the original fix for firejail symbolic links. Then, you remove the script and add the symlink instead: ``` $ sudo rm /usr/local/bin/gthumb $ sudo ln -s /usr/bin/firejail /usr/local/bin/gthumb ```
Author
Owner

@nick75e commented on GitHub (Jun 6, 2016):

Yes, it works! Thanks a lot!
Closing...

<!-- gh-comment-id:224024294 --> @nick75e commented on GitHub (Jun 6, 2016): Yes, it works! Thanks a lot! _Closing..._
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/firejail#389
No description provided.