Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option --quiet suppresses important warnings #3354

Open
rdiez opened this issue Apr 14, 2020 · 5 comments
Open

Option --quiet suppresses important warnings #3354

rdiez opened this issue Apr 14, 2020 · 5 comments
Labels
enhancement New feature request

Comments

@rdiez
Copy link

rdiez commented Apr 14, 2020

Option --quiet is simply documented as follows: Turn off Firejail's output.

Without this option, Firejail is too verbose:
------8<------8<------8<------
$ firejail --noprofile sh -c "echo a"

^[]0;firejail sh -c echo a ^Ga
Parent pid 21368, child pid 21369

Parent is shutting down, bye...
------8<------8<------8<------

Note the "^[]0;" at the beginning: Those are escape characters for some terminal. And the same with "^Ga" at the end.

Firejail should at least check whether STDOUT is a terminal before outputting such colour or terminal codes. Otherwise, the output looks weird in a log file.

Other tools like Git offer more control, see for example:
git -c color.ui=always status

I am using Ubuntu 18.04.4 LTS, which comes with Firejail version 0.9.52, a rather old version indeed. So maybe this has already been improved.

In any case, because the output looks ugly, I started using --quiet . The trouble is, Firejail stops outputting warnings like these:

Warning: you are not allowed to change /tmp to read-write
Warning: cannot create a new user namespace, going forward without it...

If some option is not working correctly, and you specified --quiet , you may never realise. Firejail needs an option to suppress unnecessary banners, echoing the command to run, and otherwise unimportant information, but such warnings should still be output.

@glitsj16
Copy link
Collaborator

You can get the latest stable release from the firejail PPA. I'm not implying that there isn't any room for improvement with regards to firejail's verbosity/error handling, but it would be handy if you can confirm these issues are still present on the latest stable release.

@rdiez
Copy link
Author

rdiez commented Apr 15, 2020

I have created a separate issue #3356 for the terminal control codes.

@rdiez
Copy link
Author

rdiez commented Apr 15, 2020

As requested, I have tested the following with the latest Firejail release version 0.9.62. I am using Ubuntu 18.04.4 LTS, so that new version came from the mentioned PPA.

  1. This command:

firejail --noprofile --read-write=/tmp sh -c "echo a"

issues warning:

Warning: you are not allowed to change /tmp to read-write

Adding option --quiet silences the warning. As I said, I think that should not happen.

  1. This command:

firejail --noprofile --blacklist=/ --noroot sh -c "echo a"

issues warning:

Warning: cannot create a new user namespace, going forward without it...

Adding option --quiet silences the warning. This is more serious than case (1), because a protection is being skipped.

@rusty-snake
Copy link
Collaborator

quiet is for programs which can pipe data over stdout to an other program where firejails you will break.

Solutions:

  1. print warnings to stderr
  2. print warnings to syslog

@rdiez
Copy link
Author

rdiez commented Apr 15, 2020

I would print warnings to stderr by default. Not many people have a habit of looking at syslog when running commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request
Projects
None yet
Development

No branches or pull requests

3 participants