[prev in list] [next in list] [prev in thread] [next in thread]
List: apparmor-dev
Subject: Re: [apparmor] [PATCH 1/2] apparmor: add clearing the profile cache when inconsistent
From: Steve Beattie <steve () nxnw ! org>
Date: 2012-08-13 23:21:01
Message-ID: 20120813232101.GQ27522 () nxnw ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Mon, Aug 13, 2012 at 02:06:12PM -0700, John Johansen wrote:
> Add the ability to clear out the binary profile cache. This removes the
> need to have a separate script to handle the logic of checking and
> removing the cache if it is out of date.
>
> The parser already does all the checking to determine cache validity
> so it makes sense to allow the parser to clear out inconsistent cache
> when it has been instructed to update the cache.
>
> Signed-off-by: John Johansen <john.johansen@canonical.com>
Coming to this patch and the problem that drove it late, I both agree
with the concept and sensible default :) as well as the implementation.
I have one minor niggle (see below), but otherwise
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
(I don't need another round of review on this patch).
I particularly like the directory walking callback mechanism, and will
try to convert the other locations where we walk directories to use it
if someone else doesn't get to it first.
> ---
> parser/parser_main.c | 167 ++++++++++++++++++++++++++++++++++++++++++-------
> parser/tst/caching.sh | 33 +++++++++-
> 2 files changed, 177 insertions(+), 23 deletions(-)
>
> diff --git a/parser/parser_main.c b/parser/parser_main.c
> index f4b4640..474dc0a 100644
> --- a/parser/parser_main.c
> +++ b/parser/parser_main.c
[SNIP]
> @@ -1256,6 +1376,11 @@ int main(int argc, char *argv[])
> return retval;
> }
>
> + if (force_clear_cache) {
> + clear_cache_files(basedir);
> + exit(0);
> + }
> +
clear_cache_files() returns a non-zero value if an error
occurred. Presumably we shouldn't be dropping it and should propagate
it in the exit() code.
Also, thanks for adding testcases! Much appreciated!
--
Steve Beattie
<sbeattie@ubuntu.com>
http://NxNW.org/~steve/
["signature.asc" (application/pgp-signature)]
--
AppArmor mailing list
AppArmor@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic