All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <method@manicmethod.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@tycho.nsa.gov, Daniel J Walsh <dwalsh@redhat.com>
Subject: Re: [patch] libselinux:  eliminate shadowed variables from audit2why
Date: Thu, 10 Jul 2008 06:58:15 -0400	[thread overview]
Message-ID: <4875EB47.9010908@manicmethod.com> (raw)
In-Reply-To: <1215615809.24864.20.camel@moss-spartans.epoch.ncsc.mil>

Stephen Smalley wrote:
> audit2why doesn't build with the default build options (-Werror) due to
> shadowed variables.  In the first case, there isn't much point in
> passing an avc argument when the rest of the file uses a static global
> variable for the same object; in the second case, we are dealing with a
> separate object returned to the caller and should name it accordingly.
> 
> Signed-off-by:  Stephen Smalley <sds@tycho.nsa.gov>

Acked-By: Joshua Brindle <method@manicmethod.com>

> 
> --- 
> 
>  libselinux/src/audit2why.c |   10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> Index: trunk/libselinux/src/audit2why.c
> ===================================================================
> --- trunk/libselinux/src/audit2why.c	(revision 2924)
> +++ trunk/libselinux/src/audit2why.c	(working copy)
> @@ -55,7 +55,7 @@
>  	return 0;
>  }
>  
> -static int check_booleans(struct avc_t *avc, struct boolean_t **bools)
> +static int check_booleans(struct boolean_t **bools)
>  {
>  	char errormsg[PATH_MAX];
>  	struct sepol_av_decision avd;
> @@ -376,7 +376,7 @@
>  		avc->tsid = tsid;
>  		avc->tclass = tclass;
>  		avc->av = av;
> -		if (check_booleans(avc, &bools) == 0) {
> +		if (check_booleans(&bools) == 0) {
>  			if (av & ~avd.auditdeny) {
>  				RETURN(DONTAUDIT)
>  			} else {
> @@ -390,15 +390,15 @@
>  				len++; b++;
>  			}
>  			b = bools;
> -			PyObject *boollist = PyTuple_New(len);
> +			PyObject *outboollist = PyTuple_New(len);
>  			len=0;
>  			while(b->name) {
>  				PyObject *bool = Py_BuildValue("(si)", b->name, b->active);
> -				PyTuple_SetItem(boollist, len++, bool);
> +				PyTuple_SetItem(outboollist, len++, bool);
>  				b++;
>  			}
>  			free(bools);
> -			PyTuple_SetItem(result, 1, boollist);
> +			PyTuple_SetItem(result, 1, outboollist);
>  			return result;
>  		}
>  	}
> 
> 



--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

      reply	other threads:[~2008-07-10 10:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-09 15:03 [patch] libselinux: eliminate shadowed variables from audit2why Stephen Smalley
2008-07-10 10:58 ` Joshua Brindle [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4875EB47.9010908@manicmethod.com \
    --to=method@manicmethod.com \
    --cc=dwalsh@redhat.com \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.