From: Mike Frysinger <vapier@gentoo.org>
To: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: ltp-list <ltp-list@lists.sf.net>, Shaz <shazalive@gmail.com>,
waqar afridi <afridi.waqar@gmail.com>
Subject: Re: [LTP] ltp: IMA cross platform fixes
Date: Wed, 22 Jul 2009 20:28:53 -0400 [thread overview]
Message-ID: <200907222028.55612.vapier@gentoo.org> (raw)
In-Reply-To: <1248297619.3714.10.camel@dyn9002018117.watson.ibm.com>
[-- Attachment #1.1: Type: text/plain, Size: 1513 bytes --]
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
> - 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))
> 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 ]
> 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
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 79 bytes --]
------------------------------------------------------------------------------
[-- Attachment #3: Type: text/plain, Size: 155 bytes --]
_______________________________________________
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-23 0: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 [this message]
2009-07-23 11:07 ` Mimi Zohar
2009-07-30 18:29 ` Subrata Modak
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=200907222028.55612.vapier@gentoo.org \
--to=vapier@gentoo.org \
--cc=afridi.waqar@gmail.com \
--cc=ltp-list@lists.sf.net \
--cc=shazalive@gmail.com \
--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.