qtcreator uses the old click manifest format which is incompatible with click hooks

Bug #1214623 reported by Jamie Strandboge
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
qtcreator (Ubuntu)
Fix Released
Critical
Juhapekka Piiroinen
Saucy
Fix Released
Critical
Juhapekka Piiroinen

Bug Description

After talking with people on #ubuntu-touch and that their click packages that were created by qtcreator did not work correctly, I examined the manifest noticed that qtcreator is creating the old format of the click manifest which is incompatible with click hooks as defined in click 0.2 and later. This can clearly be see in the Packaging tab of qtcreator, and clicking 'Advanced'. The format is documented here:
http://bazaar.launchpad.net/~click-hackers/click/trunk/view/head:/doc/hooks.rst
https://wiki.ubuntu.com/SecurityTeam/Specifications/ApplicationConfinement/Manifest#Click

Specifically, the 'security' section has been removed. In its place is the 'hooks' security with entries for each application shipped by the app and 'apparmor' and 'desktop' hooks specified under it. The apparmor hook specifies a file relative to the toplevel of the package that contains the security manifest json (which is formatted differently than what is currently in qtcreator). What needs to happen is that the security click manifest moved to a new file and that the click manifest needs to reference it.

For example, if I create an app called 'lp1214623-test-app', this is the current incorrect manifest:
{
    ...
    "name": "com.ubuntu.developer.jdstrand.lp1214623-test-app",
    "security": {
        "profiles": {
            "lp1214623-test-app": {
                "policy_groups": [
                    "networking"
                ],
                "policy_version": 1
            }
        }
    },
    "version": "0.1"
}

A corrected manifest would be:
{
    ...
    "name": "com.ubuntu.developer.jdstrand.lp1214623-test-app",
    "hooks": {
        "lp1214623-test-app": {
            "apparmor": "apparmor/lp1214623-test-app.json",
            "desktop": "lp1214623-test-app.desktop"
        }
    },
    "version": "0.1"
}

The "desktop" hook should reference the desktop file associated with the "lp1214623-test-app" application relative to the toplevel of the package (qtcreator does this already).

The "apparmor" hook should reference the json security manifest associated with the "lp1214623-test-app" application relative to the toplevel of the package. Before, the security manifest was included in the click manifest, but this was changed to be consistent with other hooks and therefore a new file must be created. Eg, qtcreator should create apparmor/lp1214623-test-app.json with the following contents:
{
    "policy_groups": [
        "networking"
    ],
    "policy_version": 1.0
}

This means that the Packaging tab will need to accommodate at least two files: the click manifest and the security manifest. Also note that while I suggest putting the security manifest in the apparmor directory, it doesn't have to be. Eg, you could put it in "lp1214623-test-app.security" if desired and adjust the click manifest to have:

{
    ...
    "hooks": {
        "lp1214623-test-app": {
            "apparmor": "lp1214623-test-app.security",
    ...
}

When fixing this bug, you will likely want to fix bug #1214618 at the same time (apparmor policy_version is incorrectly set).

Tags: appstore
Changed in qtcreator (Ubuntu Saucy):
importance: Undecided → Critical
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Marking as 'Critical' because Click packages created with QtCreator will not work properly until this bug is fixed.

description: updated
tags: added: appstore
Zoltan Balogh (bzoltan)
Changed in qtcreator (Ubuntu Saucy):
status: New → Confirmed
assignee: nobody → Juhapekka Piiroinen (juhapekka-piiroinen)
Zoltan Balogh (bzoltan)
Changed in qtcreator (Ubuntu Saucy):
status: Confirmed → Fix Committed
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

This is fixed in 2.7.1-0ubuntu5~saucy1~test4 from the sdk staging ppa.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package qtcreator - 2.7.1-0ubuntu7

---------------
qtcreator (2.7.1-0ubuntu7) saucy; urgency=low

  * debian/patches/qtcreator-plugin-ubuntu.patch:
    - Support manifest format which is compatible with click hooks
      (LP: #1214623)
    - The title is filled with the application name in the manifest
      (LP: #1214626)
    - The description field is added to the manifest file (LP: #1214612)
    - Some initial work on #1215133: Replace "_" with "-" in the name of the
      security manifest file
    - Enable Click packaging for Cordova projects (LP: #1216046)
 -- Timo Jyrinki <email address hidden> Mon, 26 Aug 2013 09:48:45 +0300

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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