Bug 23673 - pkexec fails to run X applications
Summary: pkexec fails to run X applications
Status: RESOLVED DUPLICATE of bug 38769
Alias: None
Product: PolicyKit
Classification: Unclassified
Component: daemon (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: David Zeuthen (not reading bugmail)
QA Contact: David Zeuthen (not reading bugmail)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-03 00:19 UTC by Michael Biebl
Modified: 2011-08-01 06:45 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Michael Biebl 2009-09-03 00:19:35 UTC
When I try to run a X application via pkexec, I get:
$ pkexec gedit

(process:27724): GLib-GIO-WARNING **: g_simple_async_result_complete() called from outside main loop!

(process:27724): GLib-GIO-WARNING **: g_simple_async_result_complete() called from outside main loop!

(process:27724): GLib-GIO-WARNING **: g_simple_async_result_complete() called from outside main loop!

(process:27724): GLib-GIO-WARNING **: g_simple_async_result_complete() called from outside main loop!

(process:27724): GLib-GIO-WARNING **: g_simple_async_result_complete() called from outside main loop!

(process:27724): GLib-GIO-WARNING **: g_simple_async_result_complete() called from outside main loop!

(gedit:27724): Gtk-WARNING **: cannot open display:
Comment 1 Michael Biebl 2009-09-03 00:37:31 UTC
Used versions:
polkit: 0.94
polkit-gnome: 0.94
Comment 2 David Zeuthen (not reading bugmail) 2009-09-13 10:52:13 UTC
This is kinda on purpose, the man page says

  The environment that PROGRAM will run it, will be set to a minimal
  known and safe environment in order to avoid injecting code through
  LD_LIBRARY_PATH or similar mechanisms. In addition the PKEXEC_UID
  environment variable is set to the user id of the process invoking
  pkexec. As a result, pkexec will not allow you to run e.g. X11
  applications as another user since the $DISPLAY environment variable is
  not set.

The source has a comment about it

    /* For now, avoiding pretend that running X11 apps as another user in the same session
     * will ever work... See
     *
     *  https://bugs.freedesktop.org/show_bug.cgi?id=17970#c26
     *
     * and surrounding comments for a lot of discussion about this.
     */
#if 0
    "DESKTOP_STARTUP_ID",
    "DISPLAY",
    "XAUTHORITY",
    "DBUS_SESSION_BUS_ADDRESS",
    "ORBIT_SOCKETDIR",
#endif

so it's easy to enable if you really want this... I'm not sure it's a good idea however.
Comment 3 David Zeuthen (not reading bugmail) 2009-11-30 08:59:37 UTC
Update: someone on the list asked about this - this was my reply

http://lists.freedesktop.org/archives/polkit-devel/2009-November/000264.html

Executive summary: would be nice to have but probably too much work and too many unanswered questions.
Comment 4 David Zeuthen (not reading bugmail) 2011-08-01 06:45:30 UTC

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


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.