[GH-ISSUE #2877] firejail inside firejail broken #1800

Open
opened 2026-05-05 08:28:21 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @rusty-snake on GitHub (Jul 29, 2019).
Original GitHub issue: https://github.com/netblue30/firejail/issues/2877

preparation

  • install firejail from git
  • sudo firecfg

syntax

$: regular user shell
%: shell inside firejail
>: comment
$PRG$: any program with a firecfg symlink

Issue 1

Outer firejail with private-etc without passwd.

$ firejail --private-etc="empty" --noprofile bash
% $PRG$
Error getpwuid: main.c:299 init_cfg: No such file or directory
% firejail echo
Error getpwuid: main.c:299 init_cfg: No such file or directory

Issue 2

Let's fix 1 and add passwd to private-etc.

Outer firejail with private-etc without login.defs.

adding firejail to private-etc because of 3.

$ firejail --private-etc="passwd,firejail" --noprofile bash
% firejail echo "Hello, Wolrd!"
Error: cannot read UID_MIN and/or GID_MIN from /etc/login.defs, using 1000 by default
Warning: an existing sandbox was detected. echo will run without any additional sandboxing features
Hello, Wolrd!
> Ugly message, but works.

Issue 3

$ firejail --private-etc="passwd,login.defs" --noprofile bash
% $PRG$
Error: Firejail configuration file /etc/firejail/firejail.config not found
% firejail echo "Hello, World!"
Error: Firejail configuration file /etc/firejail/firejail.config not found

Bad commit: 8bff773d @smitsohu

3.1

$ firejail --private-etc="passwd,login.defs" --noprofile $PRG$
Error: Firejail configuration file /etc/firejail/firejail.config not found

Workaround: private-bin

$ firejail --private-etc="passwd,login.defs" --noprofile --shell=none --private-bin="$PRG$" $PRG$

or

$ firejail --private-etc="passwd,login.defs" --noprofile --private-bin="$PRG$,SHELL" $PRG$
Originally created by @rusty-snake on GitHub (Jul 29, 2019). Original GitHub issue: https://github.com/netblue30/firejail/issues/2877 ## preparation * install firejail from git * `sudo firecfg` ## syntax `$`: regular user shell `%`: shell inside firejail `>`: comment `$PRG$`: any program with a firecfg symlink ## Issue 1 _Outer firejail with `private-etc` without `passwd`._ ``` $ firejail --private-etc="empty" --noprofile bash % $PRG$ Error getpwuid: main.c:299 init_cfg: No such file or directory % firejail echo Error getpwuid: main.c:299 init_cfg: No such file or directory ``` ## Issue 2 Let's fix 1 and add `passwd` to `private-etc`. _Outer firejail with `private-etc` without `login.defs`._ > adding `firejail` to `private-etc` because of 3. ``` $ firejail --private-etc="passwd,firejail" --noprofile bash % firejail echo "Hello, Wolrd!" Error: cannot read UID_MIN and/or GID_MIN from /etc/login.defs, using 1000 by default Warning: an existing sandbox was detected. echo will run without any additional sandboxing features Hello, Wolrd! > Ugly message, but works. ``` ## Issue 3 ``` $ firejail --private-etc="passwd,login.defs" --noprofile bash % $PRG$ Error: Firejail configuration file /etc/firejail/firejail.config not found % firejail echo "Hello, World!" Error: Firejail configuration file /etc/firejail/firejail.config not found ``` Bad commit: 8bff773d @smitsohu ### 3.1 ``` $ firejail --private-etc="passwd,login.defs" --noprofile $PRG$ Error: Firejail configuration file /etc/firejail/firejail.config not found ``` Workaround: `private-bin` ``` $ firejail --private-etc="passwd,login.defs" --noprofile --shell=none --private-bin="$PRG$" $PRG$ ``` or ``` $ firejail --private-etc="passwd,login.defs" --noprofile --private-bin="$PRG$,SHELL" $PRG$ ```
gitea-mirror added the
bug
firejail-in-firejail
labels 2026-05-05 08:28:21 -06:00
Author
Owner

@netblue30 commented on GitHub (Jul 31, 2019):

I guess it was broken for some time now, thanks!

<!-- gh-comment-id:517053364 --> @netblue30 commented on GitHub (Jul 31, 2019): I guess it was broken for some time now, thanks!
Author
Owner

@smitsohu commented on GitHub (Aug 1, 2019):

Bad commit: 8bff773 @smitsohu

Regarding this commit specifically, we maybe can just revert most of it. The proposed alternative (updating /etc/passwd) is the cleaner solution anyway.

<!-- gh-comment-id:517429932 --> @smitsohu commented on GitHub (Aug 1, 2019): > Bad commit: 8bff773 @smitsohu Regarding this commit specifically, we maybe can just revert most of it. The proposed alternative (updating /etc/passwd) is the cleaner solution anyway.
Author
Owner

@kmk3 commented on GitHub (Nov 21, 2025):

Error: Firejail configuration file /etc/firejail/firejail.config not found

The following PR might fix at least that error (as reported in #6966):

<!-- gh-comment-id:3561911188 --> @kmk3 commented on GitHub (Nov 21, 2025): > ``` > Error: Firejail configuration file /etc/firejail/firejail.config not found > ``` The following PR might fix at least that error (as reported in #6966): * #6970
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#1800
No description provided.