--root=... does not work under sudo

Bug #1204570 reported by Jamie Strandboge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
click (Ubuntu)
Fix Released
Medium
Colin Watson

Bug Description

Grab com.ubuntu.developer.jdstrand.evilapp_0.1_all.click from http://people.canonical.com/~jamie/evilapp/ (it should be in the app store at some point).

$ mkdir /tmp/fake_root/
$ sudo click install --root=/tmp/fake_root --force-missing-framework --user=$USER ./com.ubuntu.developer.jdstrand.evilapp_0.1_all.click
Traceback (most recent call last):
  File "/usr/bin/click", line 65, in <module>
    sys.exit(main())
  File "/usr/bin/click", line 60, in main
    mod.run(args)
  File "/usr/lib/python3/dist-packages/click/commands/install.py", line 41, in run
    installer.install(package_path, user=options.user)
  File "/usr/lib/python3/dist-packages/click/install.py", line 242, in install
    env=env)
  File "/usr/lib/python3.3/subprocess.py", line 539, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python3.3/subprocess.py", line 520, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib/python3.3/subprocess.py", line 820, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.3/subprocess.py", line 1439, in _execute_child
    raise child_exception_type(err_msg)
RuntimeError: Exception occurred in preexec_fn.

This is with click 0.2.6 and click-apparmor 0.0.4.

Related branches

Revision history for this message
Colin Watson (cjwatson) wrote :

The true error here is that you need to make /tmp/fake_root/ writable by the clickpkg user. I've fixed it for 0.2.8 to give you this exception instead:

click.install.ClickInstallerPermissionDenied: No permission to write to /tmp/fake_root as clickpkg user

Changed in click (Ubuntu):
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Colin Watson (cjwatson)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package click - 0.2.8

---------------
click (0.2.8) saucy; urgency=low

  * Check in advance whether the root is writable by the clickpkg user, not
    just by root, and do so in a way less vulnerable to useful exception
    text being eaten by a subprocess preexec_fn (LP: #1204570).
  * Actually install
    /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.click.pkla in
    the packagekit-plugin-click binary package.
 -- Colin Watson <email address hidden> Thu, 25 Jul 2013 17:40:49 +0100

Changed in click (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.