[GH-ISSUE #1819] unexpected behavior when jails have the same name ? #1237

Closed
opened 2026-05-05 07:42:33 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @thiswillbeyourgithub on GitHub (Mar 17, 2018).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1819

Hi,

I think I just found an issue : you can create several jails with the same name without seeing any warning.

Here's how to replicate it :

1 - firejail --name=test --private this creates a jail inside the terminal.
2 - then in another terminal firejail --name=test --private this creates another jail in another terminal but with the same name, without any warning that I'm aware of.
3 - I also noticed that doing firejail --join=test joined without warning or error the first jail.

I think a better behavior would be to issue a warning and automatically append a "-n" to the jail name (here it would be test-2) or at least to output a warning when trying to join an ambiguously named jail.

This problem could be a real issue for users that frequently generate jails with a keyboard shortcut (I use private jail all the time to generate unaltered firefox profile for "regular browsing" with firejail --private firefox -no-remote -private for instance).

Originally created by @thiswillbeyourgithub on GitHub (Mar 17, 2018). Original GitHub issue: https://github.com/netblue30/firejail/issues/1819 Hi, I think I just found an issue : you can create several jails with the same name without seeing any warning. Here's how to replicate it : 1 - `firejail --name=test --private` this creates a jail inside the terminal. 2 - then in another terminal `firejail --name=test --private` this creates another jail in another terminal but with the same name, without any warning that I'm aware of. 3 - I also noticed that doing `firejail --join=test` joined without warning or error the first jail. I think a better behavior would be to issue a warning and automatically append a "-n" to the jail name (here it would be `test-2`) or at least to output a warning when trying to join an ambiguously named jail. This problem could be a real issue for users that frequently generate jails with a keyboard shortcut (I use private jail all the time to generate unaltered firefox profile for "regular browsing" with `firejail --private firefox -no-remote -private` for instance).
gitea-mirror 2026-05-05 07:42:33 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@startx2017 commented on GitHub (Mar 17, 2018):

This is a bug, I'll fix it. Thanks!

<!-- gh-comment-id:373938491 --> @startx2017 commented on GitHub (Mar 17, 2018): This is a bug, I'll fix it. Thanks!
Author
Owner

@thiswillbeyourgithub commented on GitHub (Mar 23, 2018):

I don't understand. This does not actually fix the issue but is just a workaround.

You can't know which jail's PID is the one you want to use short of joining the jail and looking inside. This makes scripting with jails really hard too.

Am I missing something ?

<!-- gh-comment-id:375655293 --> @thiswillbeyourgithub commented on GitHub (Mar 23, 2018): I don't understand. This does not actually fix the issue but is just a workaround. You can't know which jail's PID is the one you want to use short of joining the jail and looking inside. This makes scripting with jails really hard too. Am I missing something ?
Author
Owner

@startx2017 commented on GitHub (Mar 23, 2018):

Try to use the PID number instead of the name of the sandbox - @netblue30 put some fixes, also I found some bugs with the name resolution. You don't need to update to the latest version in git, it doesn't affect you.

$ firejail --list
7906:startx:test:firejail --name=test
7915:startx:test:firejail --name=test
7924:startx:test:firejail --name=test
$ firejail --shutdown=7915 # shutdonw second instance

<!-- gh-comment-id:375656119 --> @startx2017 commented on GitHub (Mar 23, 2018): Try to use the PID number instead of the name of the sandbox - @netblue30 put some fixes, also I found some bugs with the name resolution. You don't need to update to the latest version in git, it doesn't affect you. $ firejail --list 7906:startx:test:firejail --name=test 7915:startx:test:firejail --name=test 7924:startx:test:firejail --name=test $ firejail --shutdown=7915 # shutdonw second instance
Author
Owner

@startx2017 commented on GitHub (Mar 23, 2018):

It is a workaround until the real fix comes in. However, the numbers go up and you can tell what the order is.

<!-- gh-comment-id:375656906 --> @startx2017 commented on GitHub (Mar 23, 2018): It is a workaround until the real fix comes in. However, the numbers go up and you can tell what the order is.
Author
Owner

@thiswillbeyourgithub commented on GitHub (Mar 23, 2018):

Oh okay I thought this was the actual fix or something. I'll use the workaround in the mean time. Thanks for taking the time :) !

<!-- gh-comment-id:375657335 --> @thiswillbeyourgithub commented on GitHub (Mar 23, 2018): Oh okay I thought this was the actual fix or something. I'll use the workaround in the mean time. Thanks for taking the time :) !
Author
Owner

@startx2017 commented on GitHub (Mar 23, 2018):

No problem.

<!-- gh-comment-id:375657491 --> @startx2017 commented on GitHub (Mar 23, 2018): No problem.
Author
Owner

@netblue30 commented on GitHub (Mar 24, 2018):

All set in git. You''ll get a name,name-1,name-2 up to name-9. After that it will just add the sandbox pid (name-PID). All of them reported properly in "firejail --list". Let us know if you run into problems, quite a number of fixes went into this one. Thanks!

<!-- gh-comment-id:375918868 --> @netblue30 commented on GitHub (Mar 24, 2018): All set in git. You''ll get a name,name-1,name-2 up to name-9. After that it will just add the sandbox pid (name-PID). All of them reported properly in "firejail --list". Let us know if you run into problems, quite a number of fixes went into this one. Thanks!
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#1237
No description provided.