[apparmor] [PATCH 02/27] apparmor: Remove -W1 warnings

Steve Beattie steve at nxnw.org
Wed Nov 21 14:32:29 UTC 2012


On Tue, Nov 20, 2012 at 08:39:42PM -0800, John Johansen wrote:
> Signed-off-by: John Johansen <john.johansen at canonical.com>
Acked-by: Steve Beattie <sbeattie at ubuntu.com>

> ---
>  security/apparmor/domain.c |    2 --
>  security/apparmor/lsm.c    |    4 ----
>  2 files changed, 6 deletions(-)
> 
> diff --git a/security/apparmor/domain.c b/security/apparmor/domain.c
> index 2cbb9df..4f61597 100644
> --- a/security/apparmor/domain.c
> +++ b/security/apparmor/domain.c
> @@ -751,7 +751,6 @@ int aa_change_profile(const char *ns_name, const char *hname, bool onexec,
>  		      bool permtest)
>  {
>  	const struct cred *cred;
> -	struct aa_task_cxt *cxt;
>  	struct aa_profile *profile, *target = NULL;
>  	struct aa_namespace *ns = NULL;
>  	struct file_perms perms = {};
> @@ -771,7 +770,6 @@ int aa_change_profile(const char *ns_name, const char *hname, bool onexec,
>  	}
>  
>  	cred = get_current_cred();
> -	cxt = cred->security;
>  	profile = aa_cred_profile(cred);
>  
>  	/*
> diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
> index 8c2a7f6..6ed009f 100644
> --- a/security/apparmor/lsm.c
> +++ b/security/apparmor/lsm.c
> @@ -469,7 +469,6 @@ static int apparmor_file_lock(struct file *file, unsigned int cmd)
>  static int common_mmap(int op, struct file *file, unsigned long prot,
>  		       unsigned long flags)
>  {
> -	struct dentry *dentry;
>  	int mask = 0;
>  
>  	if (!file || !file->f_security)
> @@ -486,7 +485,6 @@ static int common_mmap(int op, struct file *file, unsigned long prot,
>  	if (prot & PROT_EXEC)
>  		mask |= AA_EXEC_MMAP;
>  
> -	dentry = file->f_path.dentry;
>  	return common_file_perm(op, file, mask);
>  }
>  
> @@ -507,11 +505,9 @@ static int apparmor_getprocattr(struct task_struct *task, char *name,
>  				char **value)
>  {
>  	int error = -ENOENT;
> -	struct aa_profile *profile;
>  	/* released below */
>  	const struct cred *cred = get_task_cred(task);
>  	struct aa_task_cxt *cxt = cred->security;
> -	profile = aa_cred_profile(cred);
>  
>  	if (strcmp(name, "current") == 0)
>  		error = aa_getprocattr(aa_newest_version(cxt->profile),

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20121121/ebbc5338/attachment.pgp>


More information about the AppArmor mailing list