mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
utils: fix writing alias rules
Merge remote-tracking branch 'cboltz/cboltz-fix-write-alias' from Christian Boltz. 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:
commit
0b259753b8
3 changed files with 5 additions and 1 deletions
|
@ -2635,7 +2635,7 @@ def write_pair(prof_data, depth, allow, name, prefix, sep, tail, fn):
|
||||||
if ref.get(name, False):
|
if ref.get(name, False):
|
||||||
for key in sorted(ref[name].keys()):
|
for key in sorted(ref[name].keys()):
|
||||||
value = fn(ref[name][key]) # eval('%s(%s)' % (fn, ref[name][key]))
|
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():
|
if ref[name].keys():
|
||||||
data.append('')
|
data.append('')
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# A simple test comment which will persist
|
# A simple test comment which will persist
|
||||||
#include <tunables/global>
|
#include <tunables/global>
|
||||||
|
|
||||||
|
alias /foo -> /bar ,
|
||||||
|
|
||||||
/usr/bin/a/simple/cleanprof/test/profile {
|
/usr/bin/a/simple/cleanprof/test/profile {
|
||||||
# Just for the heck of it, this comment wont see the day of light
|
# Just for the heck of it, this comment wont see the day of light
|
||||||
#include <abstractions/base>
|
#include <abstractions/base>
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
alias /foo -> /bar,
|
||||||
|
|
||||||
#include <tunables/global>
|
#include <tunables/global>
|
||||||
|
|
||||||
# A simple test comment which will persist
|
# A simple test comment which will persist
|
||||||
|
|
Loading…
Add table
Reference in a new issue