Bug 1266771 - Under Wayland apps run via su or sudo are not authorised to connect to the X11 display server
Summary: Under Wayland apps run via su or sudo are not authorised to connect to the X1...
Keywords:
Status: CLOSED DUPLICATE of bug 1274451
Alias: None
Product: Fedora
Classification: Fedora
Component: wayland
Version: 24
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Adam Jackson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1268869 (view as bug list)
Depends On: 1266792
Blocks: WaylandRelated
TreeView+ depends on / blocked
 
Reported: 2015-09-27 16:15 UTC by Leslie Satenstein
Modified: 2017-05-20 09:30 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-25 09:35:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Leslie Satenstein 2015-09-27 16:15:17 UTC
Description of problem:

I often use gparted in terminal mode to select a specific disk so as to avoid scanning multiple disks (6 disks).


Version-Release number of selected component (if applicable):

Current Fedora23 Beta-RC1 version.

How reproducible:

With Gnome and standard Terminal, Gparted allows   
sudo gparted /dev/sdx  (x € a..g )
with wayland as gnome default, gparted fails to start with x11 error message(s)

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:

gparted to work fully with wayland.

Additional info:

Comment 1 Mike Fleetwood 2015-10-02 16:49:55 UTC
Please provide the terminal output from the gparted command onwards,
including the error message.

Comment 2 Leslie Satenstein 2015-10-02 21:55:07 UTC
uname -a
Linux F23SDC 4.2.1-300.fc23.x86_64 #1 SMP Mon Sep 21 22:13:13 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


With regular Gnome

[leslie@F23SDC ~]$ sudo  su
[root@F23SDC leslie]# gparted /dev/sda
Failed to execute operation: Access denied
======================
libparted : 3.2
======================

Even with the error message, gparted displays and functions properly


However ....

With Wayland

[leslie@F23SDC ~]$ sudo su
[root@F23SDC leslie]# gparted /dev/sdb
Failed to execute operation: Access denied
No protocol specified

(gpartedbin:4800): Gtk-WARNING **: cannot open display: :0
Failed to execute operation: Access denied
And there is no Gparted to be had.
 
After this last test, Gparted launched from Gnome shell by clicking on the icon, does not start.

Comment 3 Leslie Satenstein 2015-10-02 22:04:04 UTC
With above listed kernel, and Wayland,  Gparted does not start.

I select to list the icons, I clicked on the gparted icon. I see the "rotating icon (background process) active, but before I can complete entry of my password for sudo, gparted indication has disappeared.

Comment 4 Mike Fleetwood 2015-10-04 09:05:40 UTC
This is not a GParted bug.  It is that under Wayland, X11 clients run as
another user (via su or sudo) are not authorised to connect to the X11
display server.  However under native X11, clients run as another user
are authorised to connect to the X11 display server.


Under native X11 this works:

    [mike@localhost ~]$ sudo xdpyinfo | head -3
    [sudo] password for mike:
    name of display:    :0
    version number:    11.0
    vendor string:    Fedora Project


Under Wayland this fails:

    [mike@localhost ~]$ sudo xdpyinfo | head -3
    [sudo] password for mike:
    No protocol specified
    xdpyinfo:  unable to open display ":0".


So far I have found these workarounds to allow GParted to run:

1) Login as root to the GNOME on Wayland desktop

2) Allow all local connections to the X11 display server

    xhost +local:


Under native X11 the GNOME Display Manager (gdm) creates an xauth
security token to allow apps access to the X11 display server, but under
Wayland it doesn't.  I tried this but so far I haven't been able to make
it work:

    [mike@localhost ~]$ export XAUTHORITY=/run/user/`id -u`/Xauthority
    [mike@localhost ~]$ touch $XAUTHORITY
    [mike@localhost ~]$ xauth add $DISPLAY . `mcookie`
    [mike@localhost ~]$ sudo xdpyinfo | head -3
    Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo:  unable to open display ":0".


Thanks,
Mike Fleetwood (GParted Developer)

Comment 5 Mike Fleetwood 2015-10-04 09:12:29 UTC
I think this bug needs changing to the following but I don't have the
rights:

Summary:   Under Wayland apps run via su or sudo are not authorised to
           connect to the X11 display server
Component: gdm

Leslie,

You might try raising a new bug report with these details referring back
to this bug 1266771 comment 4 for more details.

Comment 6 Leslie Satenstein 2015-10-05 13:36:07 UTC
Bug 1268869 Submitted.

Comment 7 Mukundan Ragavan 2015-10-06 01:23:22 UTC
(In reply to Mike Fleetwood from comment #5)
> I think this bug needs changing to the following but I don't have the
> rights:
> 
> Summary:   Under Wayland apps run via su or sudo are not authorised to
>            connect to the X11 display server
> Component: gdm
> 

Done!

I will close the other bug report s duplicate of this one.

Comment 8 Mukundan Ragavan 2015-10-06 01:23:58 UTC
*** Bug 1268869 has been marked as a duplicate of this bug. ***

Comment 9 Mike Fleetwood 2015-11-05 20:54:13 UTC
This is still an issue with the just released Fedora 23.

Comment 10 Kamil Páral 2015-11-25 09:35:04 UTC
Marking as dupe of bug 1274451, as it contains wayland developers comments.

*** This bug has been marked as a duplicate of bug 1274451 ***

Comment 11 Leslie Satenstein 2016-10-05 20:56:04 UTC
This bug, filed September, duplicate bug filed November.

Just say, this bug replaced by bug 1274451

Still is a problem for F25 beta.

Comment 12 Kamil Páral 2016-10-06 08:27:13 UTC
The other bug has more data. No need to comment here anymore, it's closed.


Note You need to log in before you can comment on or make changes to this bug.