Public bug reported:

The following snap.yaml:

name: network-manager
...
apps:
  NetworkManager:
    ...

results in the following:
Apr 15 14:09:02 localhost.localdomain ubuntu-core-launcher[1180]: appname 
snap.network-manager.NetworkManager not allowed

This is because verify_appname() in src/main.c does not allow upper case
letters. This is easy enough to fix but then I noticed that:

1. docs/meta.md is silent on the issue of what is allowed for the keys in the 
apps dictionary (app names) of the snap.yaml
2. validate.go is not checking the contents of the key name in the apps 
dictionary

Looking at 15.04, I see this regex that applies to 'name':
`^[A-Za-z0-9/. _#:-]*$` but this is too lenient for the app name for
several reasons (so 15.04 was buggy). 16.04 uses this same regex for
validating things in apps[key], but neglects to verify 'key' itself.

I suggest we:
1. update snapd to use "^[a-zA-Z](?:-?[a-zA-Z0-9])*$" (ie, the same as snap 
name but allow upper-case)
2. adjust docs/meta.md accordingly
3. adjust ubuntu-core-launcher accordingly

** Affects: snapd (Ubuntu)
     Importance: High
         Status: Confirmed

** Affects: ubuntu-core-launcher (Ubuntu)
     Importance: High
         Status: Confirmed

** Also affects: ubuntu-core-launcher (Ubuntu)
   Importance: Undecided
       Status: New

** Changed in: snapd (Ubuntu)
       Status: New => Confirmed

** Changed in: ubuntu-core-launcher (Ubuntu)
       Status: New => Confirmed

** Changed in: snapd (Ubuntu)
   Importance: Undecided => High

** Changed in: ubuntu-core-launcher (Ubuntu)
   Importance: Undecided => High

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1570914

Title:
  inconsistent apps/key validation

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1570914/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to