[GH-ISSUE #3965] firejail fails to start if iBus is not in use, but .config/ibus/bus/* exists. #2481

Closed
opened 2026-05-05 09:09:57 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @oranenj on GitHub (Feb 9, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3965

I happened to have this in my .config:

cat .config/ibus/bus/75b2ea12f9fc4116ad6d2c56e1f24f6e-unix-0 
IBUS_ADDRESS=
IBUS_DAEMON_PID=

This causes firejail to exit immediately on startup with the following cryptic error message:

$ firejail --debug
Autoselecting /bin/bash as shell
Command name #/bin/bash#
Attempting to find default.profile...
Found default.profile profile in /etc/firejail directory
Reading profile /etc/firejail/default.profile
Found disable-common.inc profile in /etc/firejail directory
Reading profile /etc/firejail/disable-common.inc
Found disable-passwdmgr.inc profile in /etc/firejail directory
Reading profile /etc/firejail/disable-passwdmgr.inc
Found disable-programs.inc profile in /etc/firejail directory
Reading profile /etc/firejail/disable-programs.inc

** Note: you can use --noprofile to disable default.profile **

DISPLAY=:0 parsed as 0
Using the local network stack
Parent pid 6162, child pid 6163
Initializing child process
Host network configured
PID namespace installed
Mounting tmpfs on /run/firejail/mnt directory
Creating empty /run/firejail/mnt/seccomp directory
Creating empty /run/firejail/mnt/seccomp/seccomp.protocol file
Creating empty /run/firejail/mnt/seccomp/seccomp.postexec file
Creating empty /run/firejail/mnt/seccomp/seccomp.postexec32 file
IBUS_ADDRESS=
Error: invalid --env setting
Error: proc 6162 cannot sync with peer: unexpected EOF
Peer 6163 unexpectedly exited with status 1

My desktop environment does not use IBus and I'm not sure where those files came from, but removing them allows firejail to run normally. I'm assuming this code is the problem: 06e6dfe31a/src/firejail/sandbox.c (L778)

firejail should probably ignore the environment variables in those files if they are malformed or empty.

Originally created by @oranenj on GitHub (Feb 9, 2021). Original GitHub issue: https://github.com/netblue30/firejail/issues/3965 I happened to have this in my .config: ``` cat .config/ibus/bus/75b2ea12f9fc4116ad6d2c56e1f24f6e-unix-0 IBUS_ADDRESS= IBUS_DAEMON_PID= ``` This causes firejail to exit immediately on startup with the following cryptic error message: ``` $ firejail --debug Autoselecting /bin/bash as shell Command name #/bin/bash# Attempting to find default.profile... Found default.profile profile in /etc/firejail directory Reading profile /etc/firejail/default.profile Found disable-common.inc profile in /etc/firejail directory Reading profile /etc/firejail/disable-common.inc Found disable-passwdmgr.inc profile in /etc/firejail directory Reading profile /etc/firejail/disable-passwdmgr.inc Found disable-programs.inc profile in /etc/firejail directory Reading profile /etc/firejail/disable-programs.inc ** Note: you can use --noprofile to disable default.profile ** DISPLAY=:0 parsed as 0 Using the local network stack Parent pid 6162, child pid 6163 Initializing child process Host network configured PID namespace installed Mounting tmpfs on /run/firejail/mnt directory Creating empty /run/firejail/mnt/seccomp directory Creating empty /run/firejail/mnt/seccomp/seccomp.protocol file Creating empty /run/firejail/mnt/seccomp/seccomp.postexec file Creating empty /run/firejail/mnt/seccomp/seccomp.postexec32 file IBUS_ADDRESS= Error: invalid --env setting Error: proc 6162 cannot sync with peer: unexpected EOF Peer 6163 unexpectedly exited with status 1 ``` My desktop environment does not use IBus and I'm not sure where those files came from, but removing them allows firejail to run normally. I'm assuming this code is the problem: https://github.com/netblue30/firejail/blob/06e6dfe31ab23f0ed4e56799efffc03dfb1e2c0e/src/firejail/sandbox.c#L778 firejail should probably ignore the environment variables in those files if they are malformed or empty.
gitea-mirror 2026-05-05 09:09:57 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@oranenj commented on GitHub (Feb 9, 2021):

Looking at the code, the problem seems to be the env_store function is called with SETENV and not SETENV_ALLOW_EMPTY, causing it to fail.

<!-- gh-comment-id:776122421 --> @oranenj commented on GitHub (Feb 9, 2021): Looking at the code, the problem seems to be the `env_store` function is called with `SETENV` and not `SETENV_ALLOW_EMPTY`, causing it to fail.
Author
Owner

@topimiettinen commented on GitHub (Feb 11, 2021):

Current Firejail moves the environment variables away, so most of them are not used by the main setuid executable nor the unprivileged helper programs. The variables are restored for the final application. With this in mind, I think the checks for empty variables could be lifted.

<!-- gh-comment-id:777501120 --> @topimiettinen commented on GitHub (Feb 11, 2021): Current Firejail moves the environment variables away, so most of them are not used by the main setuid executable nor the unprivileged helper programs. The variables are restored for the final application. With this in mind, I think the checks for empty variables could be lifted.
Author
Owner

@topimiettinen commented on GitHub (Feb 11, 2021):

@oranenj Could you test #3974?

<!-- gh-comment-id:777539427 --> @topimiettinen commented on GitHub (Feb 11, 2021): @oranenj Could you test #3974?
Author
Owner

@oranenj commented on GitHub (Feb 11, 2021):

@topimiettinen built and seems to work. Old version of firejail fails, the patched one runs fine. I tested running my sandboxed browser with it, and nothing obvious broke, so LGTM.

<!-- gh-comment-id:777600525 --> @oranenj commented on GitHub (Feb 11, 2021): @topimiettinen built and seems to work. Old version of firejail fails, the patched one runs fine. I tested running my sandboxed browser with it, and nothing obvious broke, so LGTM.
Author
Owner

@topimiettinen commented on GitHub (Feb 11, 2021):

Thanks for testing!

<!-- gh-comment-id:777695854 --> @topimiettinen commented on GitHub (Feb 11, 2021): Thanks for testing!
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#2481
No description provided.