aa-genprof fails on disabled profile
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
AppArmor |
Fix Released
|
Undecided
|
Unassigned | ||
apparmor (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Hi,
I'm following the tutorial at https:/
When doing sudo aa-genprof firefox, I get the following error message:
Traceback (most recent call last):
File "/usr/sbin/
apparmor.
File "/usr/lib/
profile_data = get_profile(pname)
File "/usr/lib/
inactive_
AttributeError: 'ProfileStorage' object has no attribute 'pop'
So much as I can see, I have a usr.bin.firefox profile both in apparmor.d and in the disable directory.
The full trace is below:
----
AttributeError
Python 3.6.7: /usr/bin/python3
Tue Mar 12 18:23:07 2019
A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.
/usr/sbin/
105
106 profile_filename = apparmor.
107 if os.path.
108 apparmor.
109 else:
110 apparmor.
111 apparmor.
112
113 if apparmor.
114 apparmor.
apparmor = <module 'apparmor.aa' from '/usr/lib/
apparmor.autodep = <function autodep>
program = '/usr/lib/
/usr/lib/
585 else:
586 bin_full = pname # for named profiles
587
588 pname = bin_full
589 read_inactive_
590 profile_data = get_profile(pname)
591 # Create a new profile if no existing profile
592 if not profile_data:
593 profile_data = create_
594 file = get_profile_
profile_data undefined
global get_profile = <function get_profile>
pname = '/usr/lib/
/usr/lib/
495 aaui.UI_
496 inactive_profile = get_inactive_
497 if inactive_profile:
498 uname = 'Inactive local profile for %s' % prof_name
499 inactive_
500 inactive_
501 profile_
502 profile_
503 profile_
504 profile_
inactive_profile = {'/usr/
prof_name = '/usr/lib/
].pop undefined
AttributeError: 'ProfileStorage' object has no attribute 'pop'
__cause__ = None
__class__ = <class 'AttributeError'>
__context__ = None
__delattr__ = <method-wrapper '__delattr__' of AttributeError object>
__dict__ = {}
__dir__ = <built-in method __dir__ of AttributeError object>
__doc__ = 'Attribute not found.'
__eq__ = <method-wrapper '__eq__' of AttributeError object>
__format__ = <built-in method __format__ of AttributeError object>
__ge__ = <method-wrapper '__ge__' of AttributeError object>
__getattrib
__gt__ = <method-wrapper '__gt__' of AttributeError object>
__hash__ = <method-wrapper '__hash__' of AttributeError object>
__init__ = <method-wrapper '__init__' of AttributeError object>
__init_
__le__ = <method-wrapper '__le__' of AttributeError object>
__lt__ = <method-wrapper '__lt__' of AttributeError object>
__ne__ = <method-wrapper '__ne__' of AttributeError object>
__new__ = <built-in method __new__ of type object>
__reduce__ = <built-in method __reduce__ of AttributeError object>
__reduce_ex__ = <built-in method __reduce_ex__ of AttributeError object>
__repr__ = <method-wrapper '__repr__' of AttributeError object>
__setattr__ = <method-wrapper '__setattr__' of AttributeError object>
__setstate__ = <built-in method __setstate__ of AttributeError object>
__sizeof__ = <built-in method __sizeof__ of AttributeError object>
__str__ = <method-wrapper '__str__' of AttributeError object>
__subclassh
__suppress_
__traceback__ = <traceback object>
args = ("'ProfileStorage' object has no attribute 'pop'",)
with_traceback = <built-in method with_traceback of AttributeError object>
The above is a description of an error in a Python program. Here is
the original traceback:
Traceback (most recent call last):
File "/usr/sbin/
apparmor.
File "/usr/lib/
profile_data = get_profile(pname)
File "/usr/lib/
inactive_
AttributeError: 'ProfileStorage' object has no attribute 'pop'
This is already fixed upstream (in AppArmor 2.12.2 and 2.13.2), especially commit f997977e6.
However, the Ubuntu package doesn't have that fix yet, therefore I add "apparmor (Ubuntu)" to the "affects" list.
Backporting the mentioned commit probably isn't too easy (it's quite big and IIRC has dependencies on previous commits), so maybe upgrading to 2.12.2 would be easier.