-
Notifications
You must be signed in to change notification settings - Fork 584
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
bugfix: do not interact with dbus directory if dbus proxy is disabled #6591
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity, does the current code cause any issues or is this intended to just
keep /run/firejail cleaner?
It did cause an issue when I was running firejail inside a chroot environment. That's not important, but I also realized there's no point in that code running if we disable the dbus proxy code anyway, just to keep things cleaner. |
dbf0059
to
40ce858
Compare
40ce858
to
b5d4ea3
Compare
I see, but it is currently marked as a bugfix and it's not immediately obvious Could you add those details to the commit message? By the way, firejail in a chroot is likely an uncommon environment, but if you |
Sorry about that. Well the bug was, trying to run I said that it's not important, because this use case shouldn't change the fact that it shouldn't create and care about the directory if
Oh I forgot about the wiki, that's not a bad idea. Yeah I realize it's uncommon, actually I realized it even had a |
b5d4ea3
to
9a0016e
Compare
(Offtopic) Hello, please avoid rebasing to master without need (especially for branches I think it's helpful to rebase to master when:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that. Well the bug was, trying to run
firejail
inside of a
firejail --chroot=/somedir --noprofile
causes anassert
to fail which
checks whether the mode for/run/firejail/dbus
is correct, which in this
case means0755
, but the issue is that when inside of a "firejail chroot",
that directory is mounted with mode0400
probably to isolate thechroot
better, which makes sense. Even when runningsudo firejail --chroot=/somedir --noprofile
, the/run/firejail/dbus
directory still has the mode0400
.
Could you mention this issue in the commit message and how this code fixes it?
It would be nice to have it there for future reference.
It can be a short summary if you don't want to get into the details.
Also, it would be good to include the assert error message.
I said that it's not important, because this use case shouldn't change the
fact that it shouldn't create and care about the directory iffirejail
is
built withdbus
disabled. It's just a small cleanup. I probably shouldn't
have called it abugfix
, but I just felt like it might cause issues in some
other weird situations as well.
I think it's fine to call this a bugfix, as it makes --chroot=
work with a
--disable-dbusproxy
build.
Fix a failing assert when running `firejail` inside: `firejail --chroot=somedir --noprofile` firejail: ../../src/firejail/util.c:1039: create_empty_dir_as_root: Assertion `(s.st_mode & 07777) == (mode)' failed. The assert is checking whether the newly created `/run/firejail/dbus` empty directory, has the correct mode set, which in this case is `0755`. The issue is that, since the directory already exists and has the mode `0400`, because of the first ran chroot command, the assert fails. This commit circumvents this issue, by making `firejail` ignore the dbug directory entirely, in the `src/firejail/preproc.c` file when compiling the project using `configure --disable-dbusproxy`. There's also really no need for `firejail` to care about that directory if `--disable-dbusproxy` is used.
9a0016e
to
c011879
Compare
Done, I hope the commit description is clear. |
No description provided.