mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #3862] Paths in app profiles with ^ and ! wildcards in them are not expanded #2431
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#2431
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?
Originally created by @Snugface on GitHub (Jan 1, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/3862
Bug and expected behavior
^and!in them when reading profile files.[^.]*/and*!(.)/Reproduce
Steps to reproduce the behavior:
~/.config/firejail/firefox-common.profileafter the lineinclude whitelist-var-common.inc:firejail firefoxEnvironment
linux-hardened), last updated ~10 days ago# aa-statusanywhereAdditional context
~/parent_dir, and whitelist theparent_diritself and all files in it.Glob pattern
blacklist ${HOME}/parent_dir/*/was used. This also blacklisted${HOME}/parent_dir/..which is the$HOMEitself. Which broke firefox and it failed to execute.[^.]*/and.[^.]*/wildcards instead of*/.The two glob patterns list all regular and
.directories except/..if used directly from a bash shell(such as withecho [^.]*/) However, upon starting firefox I get:Error: "${HOME}/parent_dir/[^.]*/" is an invalid filename: rejected character: "^"^and!work - it's just important for me to be able to use wildcards to blacklist/whitelist all child directories, but not all files, in a specific parent directory. So if you know a specific recipe for this - please, share it. I'd be glad to tip you some $10-20 if there will be a workaround.Checklist
--profile=PROFILENAMEis used to set the right profile.LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 PROGRAMto get english error-messages.browser-allow-drm yes/browser-disable-u2f noinfirejail.configto allow DRM/U2F in browsers.debug output
@rusty-snake commented on GitHub (Mar 8, 2021):
man 7 glob: You can do[!.]*howeverError: "${HOME}/parent_dir/.[!.]*/" is an invalid filename: rejected character: "!".@rusty-snake commented on GitHub (May 12, 2021):
For me this raises two questions:
!(after[) in paths?@kmk3 commented on GitHub (May 13, 2021):
@Snugface commented on Jan 1:
I think it would be simpler to just fix globbing to ignore
/..$and/.$.@rusty-snake commented 10 hours ago:
PCRE is quite large/complex; POSIX ERE already supports
[^.]:If you really want to use an external implementation, I'd suggest using a
smaller one. Examples:
This one seems to be more common (it's used by
jqand PHP), but it's on thelarger side:
And there's a fork that's used by Ruby, though on Arch it only exists in the
AUR:
@rusty-snake commented on GitHub (May 13, 2021):
You're right, however for me:
@kmk3 commented on GitHub (May 13, 2021):
@rusty-snake commented on GitHub (May 13, 2021):
./configurewithout--enable-selinux:./configurewith--enable-selinux:@kmk3 commented on GitHub (May 13, 2021):
I see, it's a dependency of SELinux, but I don't really get what exactly is
your point.
@rusty-snake commented on GitHub (May 13, 2021):
Just to clear what causes the different
lddoutputs.I didn't know this before.@kmk3 commented on GitHub (May 13, 2021):
Ah alright; I thought that you were arguing in favor of using PCRE directly.