Bug 1266771 - Under Wayland apps run via su or sudo are not authorised to connect to the X11 display server
Under Wayland apps run via su or sudo are not authorised to connect to the X1...
Status: CLOSED DUPLICATE of bug 1274451
Product: Fedora
Classification: Fedora
Component: wayland (Show other bugs)
24
x86_64 Linux
unspecified Severity low
: ---
: ---
Assigned To: Adam Jackson
Fedora Extras Quality Assurance
:
: 1268869 (view as bug list)
Depends On: 1266792
Blocks: WaylandRelated
  Show dependency treegraph
 
Reported: 2015-09-27 12:15 EDT by Leslie Satenstein
Modified: 2017-05-20 05:30 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-25 04:35:04 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Leslie Satenstein 2015-09-27 12:15:17 EDT
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 12:49:55 EDT
Please provide the terminal output from the gparted command onwards,
including the error message.
Comment 2 Leslie Satenstein 2015-10-02 17:55:07 EDT
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 18:04:04 EDT
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 05:05:40 EDT
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 05:12:29 EDT
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 09:36:07 EDT
Bug 1268869 Submitted.
Comment 7 Mukundan Ragavan 2015-10-05 21:23:22 EDT
(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-05 21:23:58 EDT
*** Bug 1268869 has been marked as a duplicate of this bug. ***
Comment 9 Mike Fleetwood 2015-11-05 15:54:13 EST
This is still an issue with the just released Fedora 23.
Comment 10 Kamil Páral 2015-11-25 04:35:04 EST
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 16:56:04 EDT
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 04:27:13 EDT
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.