From: <ssm...@us...> - 2008-07-18 14:02:28
|
Revision: 2926 http://selinux.svn.sourceforge.net/selinux/?rev=2926&view=rev Author: ssmalley Date: 2008-07-18 14:02:26 +0000 (Fri, 18 Jul 2008) Log Message: ----------- Author: Stephen Smalley Email: sd...@ty... Subject: libselinux: eliminate shadowed variables from audit2why Date: Wed, 09 Jul 2008 11:03:29 -0400 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 <sd...@ty...> Modified Paths: -------------- trunk/libselinux/src/audit2why.c Modified: trunk/libselinux/src/audit2why.c =================================================================== --- trunk/libselinux/src/audit2why.c 2008-07-18 14:01:08 UTC (rev 2925) +++ trunk/libselinux/src/audit2why.c 2008-07-18 14:02:26 UTC (rev 2926) @@ -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 was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |