[Bug 1020115] [NEW] Spawned commands can't use pkexec

Launchpad Bug Tracker 1020115 at bugs.launchpad.net
Mon Jul 2 21:39:34 UTC 2012


You have been subscribed to a public bug:

Commands spawned from unity (from the Dash, from Alt+F2, from
indicators) can't use pkexec.

To reproduce:

1) Download attached test-getppid.py and put it in /usr/bin and chmod +x it
2) Press Alt+F2
3) Type in test-getppid.py and press Enter
4) Click the button
5) A pkexec dialog should pop up, trying to run gcalctool

When you try this script from a Terminal, it works fine.

Impact:

The Desktop team is porting uses of gksu over to pkexec.  For example,
in Software Updater, the partial upgrade and release upgrade buttons now
use pkexec.  They will be broken in quantal unless this bug is fixed (or
they are reverted to gksu to work around this).

Analysis:

The problem appears to be that getppid() returns 1.  And pkexec has the
following code:

  /* Figure out the parent process */
  pid_of_caller = getppid ();
  if (pid_of_caller == 1)
    {
      /* getppid() can return 1 if the parent died (meaning that we are reaped
       * by /sbin/init); In that case we simpy bail.
       */
      g_printerr ("Refusing to render service to dead parents.\n");
      goto out;
    }

I'm assuming that getppid() returning 1 is at fault here, not the pkexec
code, so I filed this against unity.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: unity 5.12-0ubuntu3
ProcVersionSignature: Ubuntu 3.5.0-2.2-generic 3.5.0-rc4
Uname: Linux 3.5.0-2-generic i686
ApportVersion: 2.2.5-0ubuntu1
Architecture: i386
CheckboxSubmission: 9a284f3f6b4f7829abbe27ad9573a709
CheckboxSystem: 3935143777c965daaa64b51f0134f712
Date: Mon Jul  2 09:58:25 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110422)
SourcePackage: unity
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: unity
     Importance: Medium
         Status: Triaged

** Affects: update-manager (Ubuntu)
     Importance: High
         Status: Triaged


** Tags: apport-bug i386 quantal running-unity
-- 
Spawned commands can't use pkexec
https://bugs.launchpad.net/bugs/1020115
You received this bug notification because you are a member of Ubuntu Foundations Bugs, which is subscribed to update-manager in Ubuntu.




More information about the foundations-bugs mailing list