mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
utils: fix writing alias rules
write_pair() ignored the 'tail' parameter, which resulted in writing
invalid alias rules (without the trailing comma).
Also add an alias to test/cleanprof.* to ensure it doesn't break again.
(cherry picked from commit ae4ab62855
)
Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
PR: https://gitlab.com/apparmor/apparmor/merge_requests/119
This commit is contained in:
parent
5d9a135b44
commit
dd8d3b496b
3 changed files with 5 additions and 1 deletions
|
@ -3239,7 +3239,7 @@ def write_pair(prof_data, depth, allow, name, prefix, sep, tail, fn):
|
|||
if ref.get(name, False):
|
||||
for key in sorted(ref[name].keys()):
|
||||
value = fn(ref[name][key]) # eval('%s(%s)' % (fn, ref[name][key]))
|
||||
data.append('%s%s%s%s%s%s' % (pre, allow, prefix, key, sep, value))
|
||||
data.append('%s%s%s%s%s%s%s' % (pre, allow, prefix, key, sep, value, tail))
|
||||
if ref[name].keys():
|
||||
data.append('')
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
# A simple test comment which will persist
|
||||
#include <tunables/global>
|
||||
|
||||
alias /foo -> /bar ,
|
||||
|
||||
/usr/bin/a/simple/cleanprof/test/profile {
|
||||
# Just for the heck of it, this comment wont see the day of light
|
||||
#include <abstractions/base>
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
alias /foo -> /bar,
|
||||
|
||||
#include <tunables/global>
|
||||
|
||||
# A simple test comment which will persist
|
||||
|
|
Loading…
Add table
Reference in a new issue