Comment 6 for bug 781737

Revision history for this message
Loïc Le Page (loic-le-page) wrote :

The easiest way is to recompile the policykit-1 package so as you may install or uninstall the locally patched package using dpkg later on.

To do so you may follow this procedure:

1- Install development tools:
  sudo apt-get install devscripts build-essential

2- Check that source repositories are activated with apt. You can have it through the update manager parameters or by editing the /etc/apt/sources.list file. You should have a line like this:
  deb-src http://fr.archive.ubuntu.com/ubuntu/ natty main restricted
(well, I use the french mirror but your mirror depends on where you are)

3- Get policykit-1 source package and dependencies:
  cd /usr/local/src
  sudo apt-get update
  sudo apt-get source policykit-1
  sudo apt-get build-dep policykit-1

4- Copy the patch file to the policykit-1-0.101 folder and patch the source code:
  sudo cp /path/to/anti-rights-revocation.patch ./policykit-1-0.101
  cd policykit-1-0.101
  sudo patch -p1 < ./anti-rights-revocation.patch

5- Recompile the package:
  sudo debuild -us -uc -b
  cd ..

Here you are, all compiled packages are in /usr/local/src
You can install the patched policykit-1 package locally using dpkg:
  sudo dpkg -i /usr/local/src/policykit-1_0.101-1_amd64.deb

You don't need to install other packages, they are identical to the default system packages as we only patched the polkit-agent-helper-1 binay which is included within the policykit-1_0.101-1_amd64.deb package.

Hope this will help.