On 2015-03-26 16:24:32, Seth Arnold wrote: > On Thu, Mar 26, 2015 at 04:04:14PM -0700, Steve Beattie wrote: > > it didn't ever create the directory. But in the future, we expect the > > function to go ahead and create the new cache subdirectory. So it seems > > like "create" or "init" would work for the function name, perhaps the > > latter since it also makes it valid by creating the .features file, > > which would still cover the existing situation. > > > > (Or possibly have two functions a _reset and an _init, where the > > latter creates the directory and calls the former. But I'm not > > convinced that's necessary.) > > It'd be nice if there was one method that would idempotently do the right > thing; if we've got an _init and a _reset then there's a chance that > there's a race condition in clients of the api between determining which > method ought to be used and actually using one of them,
The reason why I couldn't come up with a single method that does the right thing is because I was trying to support all of the conditional behavior that the parser supports around caching (write to the cache, skip a bad cache, create the cache directory, etc.). I think I can add one more bool parameter to the aa_policy_cache_new() function and get rid of aa_policy_cache_is_valid() and aa_policy_cache_create()/aa_policy_cache_make_valid(). I'll get some patches out early next week. Tyler
signature.asc
Description: Digital signature
-- AppArmor mailing list [email protected] Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/apparmor
