From: Subrata Modak <subrata@linux.vnet.ibm.com>
To: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: waqar afridi <afridi.waqar@gmail.com>,
ltp-list <ltp-list@lists.sf.net>, Shaz <shazalive@gmail.com>,
Mike Frysinger <vapier@gentoo.org>
Subject: Re: [LTP] ltp: IMA cross platform fixes
Date: Thu, 30 Jul 2009 23:59:12 +0530 [thread overview]
Message-ID: <1248978552.5788.60.camel@subratamodak.linux.ibm.com> (raw)
In-Reply-To: <1248347274.3884.13.camel@dyn9002018117.watson.ibm.com>
On Thu, 2009-07-23 at 07:07 -0400, Mimi Zohar wrote:
> On Wed, 2009-07-22 at 20:28 -0400, Mike Frysinger wrote:
> > On Wednesday 22 July 2009 17:20:19 Mimi Zohar wrote:
> > > testcases/kernel/security/integrity/ima/tests/ima_policy.sh
> > >
> > > - if [ "${line:0:1}" != "#" ] ; then
> > > + firstch=`expr substr "${line}" 1 1`
> > > + if [ "${firstch}" != "#" ] ; then
> >
> > the `expr` util, while pretty flexible, tends to not get used. so it'll
> > probably be easier for people to grok:
> > if [ "${line#\#}" = "${line}" ] ; then
>
> Other than the comparison needing to be '!=', this works. Thanks!
>
> > > - RC=$((`expr $RC1 + $RC2`))
> > > - if [ $RC -eq 1 ]; then
> > > + if [ $RC1 -eq 0 ] && [ $RC2 -eq 0 ]; then
> >
> > i dont see what was wrong with the original here, but if you really want to
> > rewrite this, then just change the one line to:
> > RC=$((RC1 + RC2))
>
> The test opens the policy file and attempts to open it again, while it
> is still open. The test now explicitly checks the return code from both
> opens. The return code from both opens shouldn't be 0.
>
> > > testcases/kernel/security/integrity/ima/tests/ima_tpm.sh
> > >
> > > + zero="0000000000000000000000000000000000000000"
> > >
> > > + ima_aggr=`expr substr "${line}" 49 40`
> > >
> > > - [ "${line:49:40}" -eq 0 ] || RC=$?
> > > + [ "${ima_aggr}" = "${zero}" ] || RC=$?
> >
> > these changes arent exactly equivalent. if the subst of line only returned
> > say 5 zeros, then your check wouldnt work. do you even need this ? simply
> > changing the line to ima_aggr via substr looks good enough to me. this should
> > work fine in POSIX shells:
> > [ "00000" -eq 0 ]
>
> Although the statements aren't equivalent, the current check is more
> correct. If the TPM is not enabled, the first entry
> in /sys/kernel/security/ascii_runtime, the boot aggregate, will be a
> string of zeroes.
>
> > > testcases/kernel/security/integrity/ima/tests/ima_violations.sh
> > >
> > > + tst_res TINFO $LTPTMP/imalog.$$\
> > > + "$TCID: (message ratelimiting?)"
> >
> > this shows up a few times in the patch ... if you're going to line wrap
> > things, there needs to be a space before the continuation marker for style.
> > -mike
>
> Ok.
>
> Thanks!
Mimi,
Did you send any update on this anymore ?
Regards--
Subrata
>
> Mimi
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
next prev parent reply other threads:[~2009-07-30 18:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-16 10:59 [LTP] ltp: IMA cross platform fixes Mimi Zohar
2009-07-19 5:15 ` Garrett Cooper
2009-07-19 5:26 ` Mike Frysinger
2009-07-19 5:35 ` Garrett Cooper
2009-07-19 5:48 ` Mike Frysinger
2009-07-22 21:20 ` Mimi Zohar
2009-07-23 0:28 ` Mike Frysinger
2009-07-23 11:07 ` Mimi Zohar
2009-07-30 18:29 ` Subrata Modak [this message]
2009-07-19 5:26 ` Mike Frysinger
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=1248978552.5788.60.camel@subratamodak.linux.ibm.com \
--to=subrata@linux.vnet.ibm.com \
--cc=afridi.waqar@gmail.com \
--cc=ltp-list@lists.sf.net \
--cc=shazalive@gmail.com \
--cc=vapier@gentoo.org \
--cc=zohar@linux.vnet.ibm.com \
/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.