firejail/test
Kelvin M. Klann a4e6495fd1
modif: do not follow symlinks to /dev/null on disable (#7129)
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 as `blacklist` and `read-only`), if a file is a
symlink 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
2026-04-17 18:30:28 +00:00
..
apparmor gcov testing 2026-01-16 11:17:29 -05:00
appimage gcov testing 2026-01-16 11:17:29 -05:00
apps RELNOTES and some more testing 2026-02-25 15:14:15 -05:00
capabilities gcov testing 2026-01-16 11:17:29 -05:00
chroot gcov testing 2026-01-16 11:17:29 -05:00
compile tests: compile: remove leftover --disable-man test 2026-01-25 04:39:34 -03:00
environment testing: fix strace color probing in allow-debuggers & seccomp-ptrace 2026-03-11 13:43:14 +01:00
fcopy Fix misc whitespace 2026-02-23 13:20:38 -03:00
filters testing: fix strace color probing in allow-debuggers & seccomp-ptrace 2026-03-11 13:43:14 +01:00
firecfg gcov testing 2026-01-16 11:17:29 -05:00
fnetfilter gcov testing 2026-01-16 11:17:29 -05:00
fnettrace Fix misc whitespace 2026-02-23 13:20:38 -03:00
fs modif: do not follow symlinks to /dev/null on disable (#7129) 2026-04-17 18:30:28 +00:00
network gcov testing 2026-01-16 11:17:29 -05:00
private-etc modif: replace --keep-hostname with new --hostname-randomize 2026-03-08 02:12:26 -03:00
private-lib copyright 2014-2026 all over the place 2025-12-30 08:20:44 -05:00
profiles testing; adding pierretom to the commiters list 2026-02-02 08:26:23 -05:00
seccomp-extra gcov testing 2026-01-16 11:17:29 -05:00
utils Fix misc whitespace 2026-02-23 13:20:38 -03:00
hidepid-howto Housekeeping 2019-02-17 17:04:02 -06:00
Makefile build: move cleaning of test files to test/Makefile 2026-01-17 02:14:51 -03:00