[apparmor] [PATCH 11/36] apparmor: Add interface files for profiles and namespaces

Seth Arnold seth.arnold at canonical.com
Thu May 9 03:13:50 UTC 2013


On Wed, May 01, 2013 at 02:30:56PM -0700, John Johansen wrote:
> Add basic interface files to access namespace and profile information.
> The interface files are created when a profile is loaded and removed
> when the profile or namespace is removed.
> 
> Signed-off-by: John Johansen <john.johansen at canonical.com>

> @@ -220,8 +509,10 @@ static struct aa_fs_entry aa_fs_entry_apparmor[] = {
>  	{ }
>  };
>  
> -static struct aa_fs_entry aa_fs_entry =
> -	AA_FS_DIR("apparmor", aa_fs_entry_apparmor);
> +static struct aa_fs_entry aa_fs_entry[] = {
> +	AA_FS_DIR("apparmor", aa_fs_entry_apparmor),
> +	{ }
> +};

I didn't see the reasoning behind this change.. nothing really wrong
with it, but it appeared to just complicate nearly every line of code
that touched aa_fs_entry, except one..

> @@ -1149,7 +1162,33 @@ ssize_t aa_replace_profiles(void *udata, size_t size, bool noreplace)
>  		}
>  	}
>  
> -	/* do actual replacement */
> +	/* create new fs entries for introspection if needed */
> +	list_for_each_entry(ent, &lh, list) {
> +		if (ent->old) {
> +			if (ent->rename) {
> +				// ???
> +			}
> +		} else if (ent->rename) {
> +			// ????
> +		} else {

These might need some fleshing out :) but I don't know what goes there..

How well does the filesystem work without the corresponding code?

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


More information about the AppArmor mailing list