mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #4168] Error: invalid --debug command line option if quiet-by-default is set in firejail.config #2561
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#2561
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 @ghost on GitHub (Apr 5, 2021).
Original GitHub issue: https://github.com/netblue30/firejail/issues/4168
Running
didn't work as long as
quiet-by-default yesis set in the/etc/firejail/firejail.config, what is very confusing.IMHO at least the error message should be different. Something likequite-by-default is set in the configuration. I actually would love to see--debugworking even if thequiet-by-defaultoption is set toyesin the configuration.Environment
@rusty-snake commented on GitHub (Apr 5, 2021):
I think the only way to make
--debugwork with quiet is to add--debug=file(which would be nice anyway).@ghost commented on GitHub (Apr 7, 2021):
@rusty-snake I think this is going into the right direction of what I meant. Then I had some thoughts which arouse from working with firejai and some confusion about the messages I am confronted with. After reading through the code of
src/firejaila bit and some other issues concerning quiet mode etc. I think there's a way to make messages and message handling for the end user more comprehensible and maybe solve some of the issues on the way.I think the default (without setting anything in any profile, configuration file etc.) when you start firejail should be to show only errors. When you start firejail with --verbose you would see the usual firejail output starting with profile loading etc. This would spare the quiet settings in the profiles and the
quiet-by-defaultsetting in the config.Errors (and maybe also information messages) from firejail should be prefixed with "firejail: " to differentiate from error messages coming from the sandboxed application. However that led me to the thought to route every message through a logger. A logger with debug, info and error levels would reflect the current level of implemented messages as far as I have seen it in the
src/firejail/main.cfile, but additional levels like warning etc. would be easily integratable. I see different ways to reflect a logger in the command line arguments and the configuration:The first and obvious way would be to keep the current flags and think of them like
--quiet(correlates to an inverted--errorflag and error logging and suppresses error messages),--verbose(correlates to info level logging) and--debug(correlates to debug logging). Each flag should also be represented in the configuration filefirejail.configwith alog {error | info |debug}setting. Command line arguments overwrite the value in the configuration file. Then @rusty-snake 's proposal would make it possible to route to a file for example with--{debug | error | info}-target={file | file descriptor | syslog}[: file | file descriptor | syslog]. The default target if none is given on the command line or in the configuration could bestderr. Like shown above maybe multiple targets should be possible to route for example error output tosyslogandstderr. Each of the flags should be considered as a setting of one variablelog(or so), so a--debugflag on the command line would overwrite a quiet setting in the configuration file directly without the need of booleans. I think thelogsetting would also work within profiles. Well IMHO better than being forced to start a global profile with quiet and then you cannot overwritequietwithignore quietin local profiles and so on.The other way would be to introduce new flags
--log={none | error | info | debug}and--{error | info | debug}-target{file | file descriptor | syslog}[: file | file descriptor | syslog]. To be backwards compatible , the--debug,--verboseand--quietflags would still be kept around and map to the corresponding--log=...flag, with--quietmapping tononeanderrorbeing the default. The rest of the logic would be pretty much equivalent to the logic described in the first approach.Please consider, that I haven't read through all of the code and am no a fluent C programmer so it's likely that I may have overseen something and please correct me if I'm wrong.
@netblue30 commented on GitHub (May 30, 2021):
Fixed! There will be more fixes there, but we track them in #4275