mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
utils: rewrite write_alias()
Merge remote-tracking branch 'cboltz/cboltz-rewrite-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/120/
This commit is contained in:
commit
6a2b90ba56
1 changed files with 10 additions and 1 deletions
|
@ -2665,7 +2665,16 @@ def write_change_profile(prof_data, depth):
|
|||
return data
|
||||
|
||||
def write_alias(prof_data, depth):
|
||||
return write_pair(prof_data, depth, '', 'alias', 'alias ', ' -> ', ',', quote_if_needed)
|
||||
pre = ' ' * depth
|
||||
data = []
|
||||
|
||||
if prof_data['alias']:
|
||||
for key in sorted(prof_data['alias'].keys()):
|
||||
data.append('%salias %s -> %s,' % (pre, quote_if_needed(key), quote_if_needed(prof_data['alias'][key])))
|
||||
|
||||
data.append('')
|
||||
|
||||
return data
|
||||
|
||||
def write_rlimits(prof_data, depth):
|
||||
data = []
|
||||
|
|
Loading…
Add table
Reference in a new issue