Include profile name in error message on directory exec

... to make the error message more helpful.

Inspired by https://gitlab.com/apparmor/apparmor/-/issues/285
This commit is contained in:
Christian Boltz 2022-11-20 15:09:33 +01:00
parent b904fe78a7
commit ef5c4b5085
Failed to generate hash of commit

View file

@ -835,7 +835,7 @@ def ask_exec(hashlog):
if os.path.isdir(exec_target):
raise AppArmorBug(
'exec permissions requested for directory %s. This should not happen - please open a bugreport!' % exec_target)
'exec permissions requested for directory %s (profile %s). This should not happen - please open a bugreport!' % (exec_target, full_profile))
if not aa[profile].get(hat):
continue # ignore log entries for non-existing profiles