Skip to content
  • Christian Boltz's avatar
    If a filename mentioned in audit.log contains an @, aa-logprof crashes with · 7e84f4ef
    Christian Boltz authored
    
    
      ...
      File "/home/cb/apparmor/HEAD-CLEAN/utils/apparmor/severity.py", line 147, in handle_variable_rank
          variable = regex_variable.search(resource).groups()[0]
    	  AttributeError: 'NoneType' object has no attribute 'groups'
    
    handle_variable_rank() checked with   if '@' in resource:
    and if it finds it, expects it can match a variable, which means   @{.....}
    If a filename contains a   @   this fails.
    
    The patch fixes the if condition so that it does a regex match.
    
    It also adds two testcases for filenames containing @ to make sure they
    don't cause a crash and result in the exptected severity rank.
    
    
    Acked-by: default avatarSteve Beattie <steve@nxnw.org>
    7e84f4ef