After installing clicks to /custom/click, /usr/share/click/preinstalled version are still preferred
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apparmor (Ubuntu) |
Fix Released
|
Medium
|
Jamie Strandboge | ||
apparmor (Ubuntu RTM) |
Fix Released
|
Critical
|
Jamie Strandboge | ||
click-apparmor (Ubuntu) |
Fix Released
|
Critical
|
Jamie Strandboge | ||
click-apparmor (Ubuntu RTM) |
Fix Released
|
Critical
|
Jamie Strandboge |
Bug Description
This occurs while moving click apps from the rootfs into the custom tarball. Because of this some apps fail to launch.
Test case:
Install an app on a device and verify the apparmor policy for it in /var/lib/
@{CLICK_
ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: click 0.4.32.1
ProcVersionSign
Uname: Linux 3.16.0-10-generic x86_64
NonfreeKernelMo
ApportVersion: 2.14.7-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Sep 19 07:53:58 2014
InstallationDate: Installed on 2013-04-26 (510 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
SourcePackage: click
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in click (Ubuntu): | |
assignee: | nobody → Colin Watson (cjwatson) |
importance: | Undecided → Critical |
status: | New → In Progress |
tags: | added: rtm14 |
affects: | click (Ubuntu) → click-apparmor (Ubuntu) |
Changed in click-apparmor (Ubuntu): | |
assignee: | Colin Watson (cjwatson) → nobody |
status: | In Progress → Triaged |
Changed in click-apparmor (Ubuntu): | |
assignee: | nobody → Jamie Strandboge (jdstrand) |
status: | Triaged → In Progress |
tags: | added: touch-2014-10-09 |
description: | updated |
This is quite an interesting problem. I think I've tracked it down to Hook.install_link, which calls DB.get_path to work out where a package lives so that it can set the symlink to point to the right place, and that walks the database from the bottom up. On one level this is clearly wrong; but we have to be careful here, particularly in the area of multi-user support. Consider this situation:
Initial state: share/click/ preinstalled: org.example.foo 1.0, --all-users click.ubuntu. com: org.example.foo 1.1, --user=cjwatson
/usr/
/opt/
This is clear: user cjwatson has upgraded that package from the store, but we are to leave the package at version 1.0 for all other users. There's no conflict as we can simply run system hooks for both org.example.foo 1.0 and org.example.foo 1.1, creating AppArmor profiles for both.
After system image upgrade: share/click/ preinstalled: org.example.foo 1.1, --all-users click.ubuntu. com: org.example.foo 1.1, --user=cjwatson
/usr/
/opt/
Now what do we do? If user cjwatson runs org.example.foo then they will get the version in /opt/click. ubuntu. com, but user cwayne will get the version in /usr/share/ click/preinstal led. It's not possible to simultaneously generate both AppArmor profiles; we have to pick one.
I think the proper answer here is probably to resolve versions before running system hooks. In general only the topmost database layer is available for per-user registrations, so it should always be possible to find a topmost path that is common to all users. We can then automatically unregister any conflicting versions above that and use the topmost path for system hooks.