Comment 5 for bug 1174411

Revision history for this message
Daniel Manrique (roadmr) wrote :

OK, I tried this simplistic patch:

diff --git a/plugins/backend_info.py b/plugins/backend_info.py
index 7bc7611..ea17f8d 100644
--- a/plugins/backend_info.py
+++ b/plugins/backend_info.py
@@ -108,6 +108,10 @@ class BackendInfo(Plugin):
                 call(["pgrep", "-x", "-u", str(uid), "gnome-panel|gconfd-2"],
                     stdout=PIPE, stderr=PIPE) == 0:
             prefix = ["gksu", "--message", password_text, "--"]
+ elif os.getenv("DISPLAY") and \
+ call(["which","pkexec"],
+ stdout=PIPE, stderr=PIPE) == 0:
+ prefix = ["pkexec"]
         else:
             prefix = ["sudo", "-p", password_text + " " + password_prompt]

The first weird thing is that pkexec messes with the paths, so it needs an absolute path to work. Easiest way to get it is by setting CHECKBOX_SHARE to something absolute:

CHECKBOX_SHARE=$PWD PYTHON_PATH=. bin/checkbox-qt -w data/whitelists/default.whitelist

The second thing is that it doesn't work :/ try the super key test, which requires root, and it doesn't pop up the test window, so again, I think pkexec may be eating some environment settings that are needed for this to work.