[apparmor] [PATCH] utils: Clean up file rule parsing
Tyler Hicks
tyhicks at canonical.com
Wed Apr 23 21:26:16 UTC 2014
On 2014-04-23 22:52:45, Christian Boltz wrote:
> Hello,
>
> Am Mittwoch, 23. April 2014 schrieb Tyler Hicks:
> > This patch backs out most of the changes from r2448 in favor of a
> > better approach.
> >
> > The optional "file" keyword is handled under the pre-existing
> > RE_PROFILE_PATH_ENTRY regex and a new regex,
> > RE_PROFILE_BARE_FILE_ENTRY, is created for handling bare file rules.
> >
> > Signed-off-by: Tyler Hicks <tyhicks at canonical.com>
> > Cc: Christian Boltz <apparmor at cboltz.de>
> > ---
> >
> > This patch is meant to address the feedback from cboltz regarding the
> > duplicated code in aa.py (not the duplicated test code):
> >
> > https://lists.ubuntu.com/archives/apparmor/2014-April/005616.html
> >
> > utils/apparmor/aa.py | 218
> > ++++++++++++++------------------------- utils/apparmor/aamode.py
> > | 1 +
> > utils/test/test-regex_matches.py | 82 ++++++---------
> > 3 files changed, 107 insertions(+), 194 deletions(-)
> >
> > diff --git a/utils/apparmor/aa.py b/utils/apparmor/aa.py
> > index ea1487b..05ed2d0 100644
> > --- a/utils/apparmor/aa.py
> > +++ b/utils/apparmor/aa.py
>
> > + elif RE_PROFILE_BARE_FILE_ENTRY.search(line):
> ...
> > + path_rule =
> > profile_data[profile][hat][allow]['path'][ALL] +
> > path_rule['mode'] = mode
> > + path_rule['audit'] = audit
> > + path_rule['file_prefix'] = True
>
> Please add a TODO note to cleanup the then-superfluous file rules.
I added one to delete_path_duplicates().
>
> (A follow-up patch to solve that TODO is of course also welcome ;-)
>
>
> Thanks for the cleanup!
>
> With the TODO note added,
> Acked-by: Christian Boltz <apparmor at cboltz.de>
Thanks!
>
>
> Regards,
>
> Christian Boltz
> --
> Du kannst dir einen Kernel so geschwaetzig eingestellt kompilieren, dass
> die HDD kaum noch mit dem loggen hinterherkommt (was wiederum Bugs im
> HDD-Treiber ausloesen koennte ;)) [David Haller in suse-linux]
>
>
> --
> AppArmor mailing list
> AppArmor at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140423/9d97b570/attachment.pgp>
More information about the AppArmor
mailing list