apparmor_parser -n ':name:' creates invalid '::name::' namespace

Bug #1696731 reported by Jamie Strandboge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AppArmor
New
Undecided
Unassigned

Bug Description

Filing on behalf of Gentoo user on IRC, but confirmed on Ubuntu 17.04.

# add profile with parser with 'valid'
$ echo 'profile test {}' | sudo apparmor_parser -a -n 'valid'
$ sudo aa-status|grep :valid
   :valid://test
$ echo 'profile test {}' | sudo apparmor_parser -R -n 'valid'
$ sudo aa-status|grep :valid
$

# add profile with parser with ':invalid:'
$ echo 'profile test {}' | sudo apparmor_parser -a -n ':invalid:'
$ sudo aa-status|grep :invalid
   ::invalid:://test # INVALID NAME (not alpha-numeric)
$ echo 'profile test {}' | sudo apparmor_parser -R -n ':invalid:'
apparmor_parser: Unable to remove "test". Profile doesn't exist
[254]

The documentation states that namespace names must by alpha-numeric, but apparmor_parser is not enforcing that and allows profile names with ':'. If the intention was that the use of colons was optional with --namespace, then the parser is not handling that correctly and adding extra colons when loading.

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.