Commit c613d8a8 authored by Christian Boltz's avatar Christian Boltz

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's avatarSteve Beattie <steve@nxnw.org>
parent d11055aa
......@@ -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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment