From 409a08d196a2543fa803b2a871d5fd240bd5edfd Mon Sep 17 00:00:00 2001 From: Kron4ek Date: Fri, 28 May 2021 14:22:29 +0500 Subject: [PATCH] Bind XAUTHORITY file This is required for any graphical application to work (to connect to X server) when SANDBOX is enabled. Another possible solution is to allow any local user to connect to X server by using xhost, but binding XAUTHORITY is simpler. --- conty-start.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conty-start.sh b/conty-start.sh index 7691c4d..3707f3f 100755 --- a/conty-start.sh +++ b/conty-start.sh @@ -40,7 +40,7 @@ mount_point="${working_dir}"/mnt # a problem with mounting the squashfs image due to an incorrectly calculated offset. # The size of this script -scriptsize=18030 +scriptsize=18217 # The size of the utils.tar archive # utils.tar contains bwrap and squashfuse binaries @@ -331,6 +331,11 @@ run_bwrap () { dirs="${dirs} ${bind}" fi + # Set XAUTHORITY variable if it's missing (which is unlikely) + if [ -z "${XAUTHORITY}" ]; then + XAUTHORITY="${HOME}"/.Xauthority + fi + echo "${bwrap}" --ro-bind "${mount_point}" / \ @@ -348,6 +353,7 @@ run_bwrap () { ${dirs} \ ${net} \ ${nvidia_driver_bind} \ + --ro-bind-try "${XAUTHORITY}" "${XAUTHORITY}" \ --setenv PATH "${CUSTOM_PATH}" \ "$@" }