Merge pull request #215837 from K900/fhsenv-x11-socket-permissions
buildFHSUserEnv: fix permissions on /tmp/.X11-unix
This commit is contained in:
commit
31b278c0a4
1 changed files with 13 additions and 0 deletions
|
@ -137,6 +137,18 @@ let
|
|||
fi
|
||||
done
|
||||
|
||||
declare -a x11_args
|
||||
# Always mount a tmpfs on /tmp/.X11-unix
|
||||
# Rationale: https://github.com/flatpak/flatpak/blob/be2de97e862e5ca223da40a895e54e7bf24dbfb9/common/flatpak-run.c#L277
|
||||
x11_args+=(--tmpfs /tmp/.X11-unix)
|
||||
|
||||
# Try to guess X socket path. This doesn't cover _everything_, but it covers some things.
|
||||
if [[ "$DISPLAY" == :* ]]; then
|
||||
display_nr=''${DISPLAY#?}
|
||||
local_socket=/tmp/.X11-unix/X$display_nr
|
||||
x11_args+=(--ro-bind-try "$local_socket" "$local_socket")
|
||||
fi
|
||||
|
||||
cmd=(
|
||||
${bubblewrap}/bin/bwrap
|
||||
--dev-bind /dev /dev
|
||||
|
@ -171,6 +183,7 @@ let
|
|||
"''${ro_mounts[@]}"
|
||||
"''${symlinks[@]}"
|
||||
"''${auto_mounts[@]}"
|
||||
"''${x11_args[@]}"
|
||||
${concatStringsSep "\n " extraBwrapArgs}
|
||||
${init runScript}/bin/${name}-init ${initArgs}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue