mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
fix "list index out of range" when allowing inet rules
When adding inet rules in aa-logprof, it crashes with IndexError: list index out of range The reason is that it doesn't display the options if only the raw rule is available (aka "no abstraction"). This patch checks if options[] is set and otherwise sets selection to the raw rule. Acked-by: Steve Beattie <steve@nxnw.org>
This commit is contained in:
parent
d11055aa0c
commit
c613d8a884
1 changed files with 4 additions and 1 deletions
|
@ -1993,7 +1993,10 @@ def ask_the_questions():
|
|||
q.headers += [_('Socket Type'), sock_type]
|
||||
|
||||
elif ans == 'CMD_ALLOW':
|
||||
selection = options[selected]
|
||||
if options:
|
||||
selection = options[selected]
|
||||
else:
|
||||
selection = 'network %s %s' % (family, sock_type)
|
||||
done = True
|
||||
if re_match_include(selection): # re.search('#include\s+<.+>$', selection):
|
||||
inc = re_match_include(selection) # re.search('#include\s+<(.+)>$', selection).groups()[0]
|
||||
|
|
Loading…
Add table
Reference in a new issue