mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
prevent adding multiple quotes in file rules
aa-cleanprof (and others?) duplicate quotes in file rules. If a profile contains "/bin/foo bar" mrix, and I run aa-cleanprof on it several times, I end up with """"""/bin/foo bar"""""" mrix, This patch calls strip_quotes on the pathname. (If needed, the quotes are re-added when writing the profile - tested with aa-cleanprof.) References: https://bugs.launchpad.net/apparmor/+bug/1328707 Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
This commit is contained in:
parent
7ef2ae9b05
commit
9a960a22a9
1 changed files with 2 additions and 2 deletions
|
@ -2903,7 +2903,7 @@ def parse_profile_data(data, file, do_include):
|
|||
if matches[3]:
|
||||
file_prefix = True
|
||||
|
||||
path = matches[4].strip()
|
||||
path = strip_quotes(matches[4].strip())
|
||||
mode = matches[5]
|
||||
nt_name = matches[6]
|
||||
if nt_name:
|
||||
|
@ -4200,7 +4200,7 @@ def serialize_profile_from_old_profile(profile_data, name, options):
|
|||
if matches[2]:
|
||||
user = True
|
||||
|
||||
path = matches[4].strip()
|
||||
path = strip_quotes(matches[4].strip())
|
||||
mode = matches[5]
|
||||
nt_name = matches[6]
|
||||
if nt_name:
|
||||
|
|
Loading…
Add table
Reference in a new issue