mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[PR #7129] [MERGED] modif: stop following symlinks to /dev/null on disable #6331
Labels
No labels
LTS merge
LTS merge
bug
bug
converted-to-discussion
doc-todo
documentation
duplicate
enhancement
file-transfer
firecfg
firejail-in-firejail
firetools
graphics
help wanted
information_old
installation
invalid
modif
moved
needinfo
networking
notabug
notourbug
old-version
overlayfs
packaging
profile-request
pull-request
question
question_old
removal
runtime-permissions
sandbox-ipc
security
stale
wiki
wiki
wontfix
wordpress
workaround
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/firejail#6331
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/netblue30/firejail/pull/7129
Author: @kmk3
Created: 4/10/2026
Status: ✅ Merged
Merged: 4/17/2026
Merged by: @kmk3
Base:
master← Head:nofollow-dev-null-symlinks📝 Commits (1)
362e177modif: do not follow symlinks to /dev/null on disable📊 Changes
6 files changed (+101 additions, -10 deletions)
View changed files
📝
src/firejail/fs.c(+26 -10)📝
src/man/firejail-profile.5.in(+7 -0)📝
src/man/firejail.1.in(+7 -0)➕
test/fs/devnull_symlink(+1 -0)➕
test/fs/disable-devnull-symlink.exp(+57 -0)📝
test/fs/fs.sh(+3 -0)📄 Description
When trying to prevent a file or directory in the user home from being
written to, it is not uncommon to replace it with a symlink to
/dev/null.
If this path is also blacklisted (such as by disable-common.inc), the
symlink will be followed, resulting in /dev/null itself being
blacklisted, which can cause issues with (unrelated) programs that have
their output redirected to /dev/null (for example).
To avoid disabling /dev/null, when applying commands from
disable_file()(such asblacklistandread-only), if a file is asymlink to /dev/null, avoid following the symlink and perform the
operation on the link itself instead.
Using these commands with "/dev/null" directly as the argument (that is,
without going through a symlink) should still work the same way.
It has been confirmed to work on Linux 3.8[1], so it should work on at
least 3.8 and later.
Closes #5803.
[1] https://github.com/netblue30/firejail/pull/7129#issuecomment-4233141574
Reported-by: @fgpietersz
Suggested-by: @Changaco
Tested-by: @Changaco
Tested-by: @Zopolis4
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.