apparmor_parser -n ':name:' creates invalid '::name::' namespace
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:
$ 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.