Bug 1403041

Summary: Can't run gui apps with sudo - Cannot open display:
Product: [Fedora] Fedora Reporter: Steven Usdansky <usdanskys>
Component: sudoAssignee: Radovan Sroka <rsroka>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 26CC: arnaud.kleinveld, dkopecek, jvymazal, kzak, rsroka, tmraz, tosykora
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-23 11:26:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Steven Usdansky 2016-12-09 00:27:36 UTC
Description of problem: sudo <gui-app> gives the error message
<gui-app>: Cannot open display: 
for values of gui-app equal to everything I've tried in my Rawhide-Mate installation and todays Rawhide mate and LXDE live isos.


Version-Release number of selected component (if applicable):
pam-1.3.0-1.fc25.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Boot to Mate or LXDE desktop
2. Open terminal window
3. sudo leafpad or sudo pluma or sudo any-gui-app

Actual results: (shown for leafpad from LXDE live session)
[liveuser@localhost-live pam.d]$ sudo leafpad
leafpad: Cannot open display: 

Expected results:
leafpad runs as root and opens as expeced

Additional info:
Found the two lines below online. Adding these lines to /etc/pam.d/sudo made the problem vanish. However, I don't know what I'm doing here and have no idea why it works.

# Forward xauth keys between users if invoker is root or UID 1000 or higher
session optional pam_xauth.so systemuser=999

Comment 1 Arnaud Kleinveld 2017-02-12 04:02:35 UTC
Possible duplicate of bug 1273255

Comment 2 Fedora End Of Life 2017-02-28 10:45:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 3 Radovan Sroka 2017-10-23 11:26:05 UTC
Closing as duplicate and it seems like it is working now in latest fedora.

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