mirror of
https://github.com/netblue30/firejail.git
synced 2026-05-15 14:16:14 -06:00
[GH-ISSUE #1138] CentOS: private-tmp problems #785
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#785
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 @msva on GitHub (Mar 10, 2017).
Original GitHub issue: https://github.com/netblue30/firejail/issues/1138
I faced strange issue: when I trying to run firefox with .desktop-file (having
Exec=firefox %u), it does not start, saying:Even if I set Terminal=1 (to run in terminal).
But when I start it from manually opened terminal window (from shell), it starts and works just fine...
Can you advice me, why can this happen?
@Ferroin commented on GitHub (Mar 10, 2017):
It's probably some difference in the environment variables. When you start firejail from the terminal, it inherits all the environment from the shell you used to start it, which if it's a terminal emulator, includes both all the environment variables from the desktop environment, and all the environment variables that get set in shell startup and user login files. When you start it through a desktop file, you only get the environment variables from the desktop environment (and possibly not all of them too, depending on the DE). I'm betting it's missing something it should see in the environment variables for authentication to the X server.
@msva commented on GitHub (Mar 10, 2017):
@Ferroin Doubt it. The only diffetence is:
And, yes, I guess, you've noticed
/home/mva/.Xauthorityvs/tmp/xauth-1000-_0, but I checked that files and they are identical :-/@msva commented on GitHub (Mar 10, 2017):
Although, okay, I found the problem: firefox also (as slack) using
private-tmp, and... do not copy/tmp/xauth-1000-_0to the jail :-/@msva commented on GitHub (Mar 11, 2017):
Uhm... I found mostly strange part of this behaviour:
XAUTHORITY=${HOME}/.Xauthority(just like if I run from terminal). And fj works fine.kde-open5) it getsXAUTHORITY=${TEMPDIR:-/tmp}/xinit-${USER}-${DISPLAY/:/_}value. I've found this in kde sources, but I unsure if it is the case (first of all, my kinit binary has no XAUTHORITY string inside, and secondly, the variable is defined in other cases...So... For now, I trying to debug the issue with KDE guys (although without any luck still), but anyway, @netblue30, can you add the code to either:
XAUTHORITY(but not the hardcoded~/.Xauthority) into the jail (even in case ofprivate-tmp)or
${XAUTHORITY}in profiles and add it to the whitelist in, at least, firefox profile?@msva commented on GitHub (Mar 11, 2017):
@SYN-cook Gentoo. But why?
@netblue30 commented on GitHub (Mar 13, 2017):
I run into the problem with private-tmp on centos a few days ago, so I removed private-tmp from the profile.
I'll look into this, maybe I can bring back private-tmp. Thanks!
@netblue30 commented on GitHub (Mar 13, 2017):
More info from @msva
Actually I run into it on a CentOS under KDE.
Let me try this, maybe will fix it.
@msva commented on GitHub (Mar 13, 2017):
By the way, I have a bit more thinking and I decided that hardcoding
XAUTHORITYenvironment variable to~/.Xauthorityin the sources is a bad idea, since some distros can use another default path.And it is anyway
envoption in firejail (although, I didn't test if it is supported in the profiles).So, it can be added
env XAUTHORITY=${HOME}/.Xauthorityin default Fx profile (keeping possibility for user to redefine that).And, better fix would be, as I suggested above, to copy the file listed in host's
XAUTHORITYvariable (although, also obey the value, defined withenvoption in profile/commandline), instead of hardcoded~/.Xauthority.@netblue30 commented on GitHub (Mar 16, 2017):
You are right, it is more a KDE problem than CentOS. I think it affects all KDE users. I will disable temporarily private-tmp in all profiles on 0.9.44-bugfix branch (https://github.com/netblue30/firejail/tree/0.9.44-bugfixes) and I will do a new release from this branch. The real fix will follow after that on mainline.
@msva commented on GitHub (Mar 16, 2017):
By the way, I fixed it with:
I just analyzed the KDE code I shared above, and found that it don't reassign
XAUTHORITY variable if can't access that file.
And I also forced in-home XAUTHORITY path just in case :)
@netblue30 commented on GitHub (Mar 22, 2017):
Fixed on mainline, thanks for the bug!