Comment 40 for bug 1652282

Revision history for this message
Phillip Susi (psusi) wrote : Re: [Bug 1652282] Re: Xwayland not using XAUTHORITY, prevents root applications from connecting

On 12/7/2017 3:39 PM, Jeremy Bicha wrote:
> $ sudo su
> root@mycomputer:/home/me# gedit
> No protocol specified
> Unable to init server: Could not connect: Connection refused
>
> (gedit:4492): Gtk-WARNING **: cannot open display: :0

sudo defaults to scrubbing the environment; use sudo -E gedit instead of
sudo su. Or on Debian just use su without the - argument. sudo was
explicitly configured to not scrub DISPLAY so that users can still run
X11 applications after sudoing, but has not been updated to include
WAYLAND_DISPLAY in that list. You can also of course, simply set
WAYLAND_DISPLAY after sudoing to root.

> Therefore, I'm closing this bug. Sorry.

I'm sorry, but as long as the man page for gdm says that it will
configure an XAUTHORITY and it does not, this is ipso facto, a bug,
whatever you think about gui applications running as root.

If this really was an intentional change upstream, they should document
it in the NEWS and man page. I certainly have not been able to find
anything in the changelog or git commit history that indicates this was
intentional, and of course, the man page should be updated to match the
new implementation if it was intended.