From b8b72458007885b2bcb791290622908ea26d1805 Mon Sep 17 00:00:00 2001 From: Kan Li Date: Fri, 2 Oct 2020 19:42:32 -0700 Subject: [PATCH] images, pkg/utils: Allow X11 clients to run as root It's necessary to propagate the XAUTHORITY environment variable from the host when an X11 client is run as 'sudo '. If an X11 client is started inside a 'su -' session, then xauth(1) needs to be present so that pam_xauth.so can add a new XAUTHORITY environment variable to the 'su -' session. https://github.com/containers/toolbox/pull/572 --- images/fedora/f31/extra-packages | 1 + images/fedora/f32/extra-packages | 1 + images/fedora/f33/extra-packages | 1 + images/fedora/f34/extra-packages | 1 + src/pkg/utils/utils.go | 1 + toolbox | 1 + 6 files changed, 6 insertions(+) diff --git a/images/fedora/f31/extra-packages b/images/fedora/f31/extra-packages index 24291797a..0597b1b40 100644 --- a/images/fedora/f31/extra-packages +++ b/images/fedora/f31/extra-packages @@ -36,5 +36,6 @@ vte-profile wget which words +xorg-x11-xauth xz zip diff --git a/images/fedora/f32/extra-packages b/images/fedora/f32/extra-packages index 24291797a..0597b1b40 100644 --- a/images/fedora/f32/extra-packages +++ b/images/fedora/f32/extra-packages @@ -36,5 +36,6 @@ vte-profile wget which words +xorg-x11-xauth xz zip diff --git a/images/fedora/f33/extra-packages b/images/fedora/f33/extra-packages index 24291797a..0597b1b40 100644 --- a/images/fedora/f33/extra-packages +++ b/images/fedora/f33/extra-packages @@ -36,5 +36,6 @@ vte-profile wget which words +xorg-x11-xauth xz zip diff --git a/images/fedora/f34/extra-packages b/images/fedora/f34/extra-packages index 24291797a..0597b1b40 100644 --- a/images/fedora/f34/extra-packages +++ b/images/fedora/f34/extra-packages @@ -36,5 +36,6 @@ vte-profile wget which words +xorg-x11-xauth xz zip diff --git a/src/pkg/utils/utils.go b/src/pkg/utils/utils.go index 8312436a4..5455298cb 100644 --- a/src/pkg/utils/utils.go +++ b/src/pkg/utils/utils.go @@ -65,6 +65,7 @@ var ( "TOOLBOX_PATH", "VTE_VERSION", "WAYLAND_DISPLAY", + "XAUTHORITY", "XDG_CURRENT_DESKTOP", "XDG_DATA_DIRS", "XDG_MENU_PREFIX", diff --git a/toolbox b/toolbox index 2c8951cce..8a8c16727 100755 --- a/toolbox +++ b/toolbox @@ -43,6 +43,7 @@ environment_variables="COLORTERM \ TOOLBOX_PATH \ VTE_VERSION \ WAYLAND_DISPLAY \ + XAUTHORITY \ XDG_CURRENT_DESKTOP \ XDG_DATA_DIRS \ XDG_MENU_PREFIX \