[apparmor] [PATCH 2/6] libapparmor: Rename aa_policy_cache_create

Seth Arnold seth.arnold at canonical.com
Thu Mar 26 23:24:32 UTC 2015


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,

Of course the only names that come to mind are "mkdir -p", _idem, and
other horrible things. _create feels least bad, at least if it will
actually create the directory if needed.

Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150326/e9d013d6/attachment.pgp>


More information about the AppArmor mailing list