Merge pull request #215837 from K900/fhsenv-x11-socket-permissions
buildFHSUserEnv: fix permissions on /tmp/.X11-unix
This commit is contained in:
commit
31b278c0a4
|
@ -137,6 +137,18 @@ let
|
||||||
fi
|
fi
|
||||||
done
|
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=(
|
cmd=(
|
||||||
${bubblewrap}/bin/bwrap
|
${bubblewrap}/bin/bwrap
|
||||||
--dev-bind /dev /dev
|
--dev-bind /dev /dev
|
||||||
|
@ -171,6 +183,7 @@ let
|
||||||
"''${ro_mounts[@]}"
|
"''${ro_mounts[@]}"
|
||||||
"''${symlinks[@]}"
|
"''${symlinks[@]}"
|
||||||
"''${auto_mounts[@]}"
|
"''${auto_mounts[@]}"
|
||||||
|
"''${x11_args[@]}"
|
||||||
${concatStringsSep "\n " extraBwrapArgs}
|
${concatStringsSep "\n " extraBwrapArgs}
|
||||||
${init runScript}/bin/${name}-init ${initArgs}
|
${init runScript}/bin/${name}-init ${initArgs}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue