mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[PR #6704] [MERGED] feature: use globbing in hardcoded numbered /dev paths #6128
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#6128
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/6704
Author: @kmk3
Created: 4/10/2025
Status: ✅ Merged
Merged: 4/12/2025
Merged by: @kmk3
Base:
master← Head:private-dev-glob📝 Commits (7)
c5fba25fs_dev.c: sort includes9934dd1fs_dev.c: fix misc whitespace57c937efs_dev.c: reduce indentation in deventry_mount1c11f64fs_dev.c: split deventry_mount into should_mount4b99bd9fs_dev.c: split deventry_mount into deventry_mount_alledf623ffs_dev.c: improve checks and logging in deventry_mount7ae5db2feature: use globbing in hardcoded numbered /dev paths📊 Changes
1 file changed (+253 additions, -122 deletions)
View changed files
📝
src/firejail/fs_dev.c(+253 -122)📄 Description
Certain devices appear in numbered paths in /dev (such as
/dev/hidraw0or
/dev/hidraw1) when they are plugged in. When private-dev is used,it attempts to include a hardcoded list of /dev paths in the sandbox.
Since the hardcoded paths only go up to a specific number (mostly from 0
to 9), devices that appear at higher numbered paths (such as
/dev/hidraw10or/dev/hidraw20) do not show up in /dev whenprivate-dev is enabled.
This issue also affects options that attempt to disable numbered paths
(such as --no3d and --nou2f), independently of whether private-dev is
used.
Fix this by using glob patterns (such as
/dev/hidraw[0-9]*) to ensurethat all relevant numbered paths are matched regardless of number.
The globbing is similar to the one from commit
2993298aa("firecfg:parse config files in /etc/firejail/firecfg.d", 2023-06-29) / PR #5876.
Closes #2723.
Reported-by: @tsankuanglee
Reported-by: @WPettersson
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.