Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1236528 (qt4-no-root) - qt4 apps cannot run as root
Summary: qt4 apps cannot run as root
Keywords:
Status: ASSIGNED
Alias: qt4-no-root
Product: Fedora
Classification: Fedora
Component: qt
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Than Ngo
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: https://fedoraproject.org/wiki/Common...
: 1269862 (view as bug list)
Depends On:
Blocks: 1185893 1196237 1212180 1219284 1229874 1236529
TreeView+ depends on / blocked
 
Reported: 2015-06-29 11:16 UTC by James Patterson
Modified: 2020-12-26 10:02 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description James Patterson 2015-06-29 11:16:50 UTC
Description of problem:
Several qt4 apps fail to start unless QT_X11_NO_MITSHM=1 is set.

This bug will track them.

Typical error:
 X Error: BadDrawable (invalid Pixmap or Window parameter) 9
 Major opcode: 62 (X_CopyArea)
 Resource id:  0x2400100
Workaround:
 QT_X11_NO_MITSHM=1 commandname

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Rex Dieter 2015-06-29 12:14:35 UTC
do you have any specific examples?

Comment 2 Rex Dieter 2015-06-29 12:25:30 UTC
oh, via the linked bug, this is only about running apps as root apparently (correct me if I'm wrong).

Comment 3 Rex Dieter 2015-06-29 12:27:40 UTC
See also https://bugzilla.redhat.com/show_bug.cgi?id=1212180#c7, quote:

As explained in bug 1185893 this has been discussed on the xorg-devel list and we do not consider this an Xorg bug, the problem is lack of proper error checking of the MIT SHM extension related X calls in the app / toolkit. This actually is a feature because people are now getting proper protection of unauthorized accesses to their shared memory segments where before anyone could access them (as the X-server was doing the accessing and it ran as root). So I'm re-opening this.

Also gui apps should really not run as root, ever. I realize this is sometimes easiest, but we should not ship anything setup this way ootb and/or depending on this (running as root).

Note I've also discussed this with the some qt people and it is fixed in qt5, and currently there are no plans to fix this for qt4, there answer to this problem is: Do not run gui apps as root.

Note that there is a workaround  for qt4 described in bug 1185893:

kcalc --graphicssystem native

Comment 4 Rex Dieter 2015-06-29 12:38:52 UTC
Adjusting summary, workarounds include:
1. set QT_X11_NO_MITSHM=1 env var
2. set QT_GRAPHICSSYSTEM=native env var

Comment 5 James Patterson 2015-06-29 13:47:46 UTC
> Also gui apps should really not run as root, ever. I realize this is sometimes easiest

How does one run an app that needs root permissions then?

Say access to /dev/sdX (example for unetbootin)

Comment 6 Rex Dieter 2015-06-29 13:50:41 UTC
One best practice these days is to use minimal (non-gui) helper apps that raise priveledge via policykit

Comment 7 James Patterson 2015-06-29 19:07:25 UTC
I'm an end-user, I can't do that.

Comment 8 Rex Dieter 2015-06-29 19:08:32 UTC
sorry for being unclear, it's what application authors/developers ought to be using

Comment 9 Kevin Kofler 2015-10-08 21:25:01 UTC
*** Bug 1269862 has been marked as a duplicate of this bug. ***

Comment 10 Pablo Rodríguez 2016-02-29 20:41:12 UTC
I cannot code, but I wonder if anyone could help with this: https://github.com/unetbootin/unetbootin/issues/56#issuecomment-190355265.


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