diff options
| author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2014-06-05 10:23:44 -0300 | 
|---|---|---|
| committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2014-06-05 11:01:11 -0300 | 
| commit | 6e19fd7c55ae1c4520536cb272b1ffcb6e8abd4c (patch) | |
| tree | eb4ba10164491e8706a0300a5405d73cef073b01 | |
| parent | 82e1c4b1e3e5dd49b6e868732451a744ba37ba59 (diff) | |
Add support for gnome-shell polkit agent.
The gnome-shell desktop does not uses a separate process as others do.
It uses an agent within its own process so we need to check for
gnome-shell and then assume that its polkit is working.
| -rw-r--r-- | changes/bug-4144_support-gnome-shell-polkit | 1 | ||||
| -rw-r--r-- | src/leap/bitmask/services/eip/linuxvpnlauncher.py | 15 | 
2 files changed, 15 insertions, 1 deletions
diff --git a/changes/bug-4144_support-gnome-shell-polkit b/changes/bug-4144_support-gnome-shell-polkit new file mode 100644 index 00000000..b8da093c --- /dev/null +++ b/changes/bug-4144_support-gnome-shell-polkit @@ -0,0 +1 @@ +- Add support for gnome-shell polkit agent. Closes #4144, #4218. diff --git a/src/leap/bitmask/services/eip/linuxvpnlauncher.py b/src/leap/bitmask/services/eip/linuxvpnlauncher.py index 1f0813e0..54845a8a 100644 --- a/src/leap/bitmask/services/eip/linuxvpnlauncher.py +++ b/src/leap/bitmask/services/eip/linuxvpnlauncher.py @@ -71,7 +71,20 @@ def _is_auth_agent_running():          'ps aux | grep "[l]xpolkit"'      ]      is_running = [commands.getoutput(cmd) for cmd in polkit_options] -    return any(is_running) + +    # gnome-shell does not uses a separate process for the polkit-agent, it +    # uses a polkit-agent within its own process so we can't ps-grep it. +    is_running = any(is_running) +    if not is_running: +        is_gnome_shell = commands.getoutput('ps aux | grep [g]nome-shell') + +        # $DESKTOP_SESSION == 'gnome' -> gnome-shell +        # $DESKTOP_SESSION == 'gnome-fallback' -> gnome-shell fallback mode, +        # uses polkit-gnome... +        if is_gnome_shell and os.getenv("DESKTOP_SESSION") == 'gnome': +            is_running = True + +    return is_running  def _try_to_launch_agent():  | 
