The new aa.py module does not handle a bare capability rule and emits a traceback.
$ mkdir /tmp/profiles $ printf "profile cap {\n capability,\n}" >/tmp/profiles/cap $ sudo ./aa-enforce -d /tmp/profs /tmp/profs/cap Traceback (most recent call last): File "./aa-enforce", line 30, in <module> tool.cmd_enforce() File "/var/scm/apparmor.git/utils/apparmor/tools.py", line 153, in cmd_enforce apparmor.read_profiles() File "/var/scm/apparmor.git/utils/apparmor/aa.py", line 2558, in read_profiles read_profile(profile_dir + '/' + file, True) File "/var/scm/apparmor.git/utils/apparmor/aa.py", line 2584, in read_profile profile_data = parse_profile_data(data, file, 0) File "/var/scm/apparmor.git/utils/apparmor/aa.py", line 3031, in parse_profile_data raise AppArmorException(_('Syntax Error: Unknown line found in file: %s line: %s') % (file, lineno + 1)) apparmor.common.AppArmorException: 'Syntax Error: Unknown line found in file: /tmp/profs/cap line: 2'
The new aa.py module does not handle a bare capability rule and emits a traceback.
$ mkdir /tmp/profiles cmd_enforce( ) apparmor. git/utils/ apparmor/ tools.py" , line 153, in cmd_enforce read_profiles( ) apparmor. git/utils/ apparmor/ aa.py", line 2558, in read_profiles profile( profile_ dir + '/' + file, True) apparmor. git/utils/ apparmor/ aa.py", line 2584, in read_profile data(data, file, 0) apparmor. git/utils/ apparmor/ aa.py", line 3031, in parse_profile_data on(_('Syntax Error: Unknown line found in file: %s line: %s') % (file, lineno + 1)) common. AppArmorExcepti on: 'Syntax Error: Unknown line found in file: /tmp/profs/cap line: 2'
$ printf "profile cap {\n capability,\n}" >/tmp/profiles/cap
$ sudo ./aa-enforce -d /tmp/profs /tmp/profs/cap
Traceback (most recent call last):
File "./aa-enforce", line 30, in <module>
tool.
File "/var/scm/
apparmor.
File "/var/scm/
read_
File "/var/scm/
profile_data = parse_profile_
File "/var/scm/
raise AppArmorExcepti
apparmor.