From: Garrett C. <ris...@li...> - 2010-07-02 17:03:18
|
The branch, next, has been updated via ab17ee7ea998edacc72c4c6a27161def5dc12f5d (commit) via f65393e3bda833416f578618cbf79b2428cbac95 (commit) from 8e990dfc00206bfa484ff5097127869278a46636 (commit) - Log ----------------------------------------------------------------- commit ab17ee7ea998edacc72c4c6a27161def5dc12f5d Author: Garrett Cooper <yan...@gm...> Date: Fri Jul 2 01:13:01 2010 -0700 ima_measure doesn't build correctly. It needs config.h to determine whether openssl headers are present, and verbose needs to be global. Broken by commit ef77253961f909f87e82e6d2b620e87af33e9665. Signed-off-by: Stephen D. Smalley <sd...@ty...> Tested-by: Garrett Cooper <yan...@gm...> commit f65393e3bda833416f578618cbf79b2428cbac95 Author: Garrett Cooper <yan...@gm...> Date: Fri Jul 2 01:09:39 2010 -0700 Fix issues with setup in ima_setup.sh. Fix an unbound variable and the mkdir $TMPDIR call should be doing mkdir -p $TMPDIR as the directory hierarchy may not exist yet. Signed-off-by: Garrett Cooper <yan...@gm...> ----------------------------------------------------------------------- Summary of changes: .../security/integrity/ima/src/ima_measure.c | 7 ++++--- .../security/integrity/ima/tests/ima_setup.sh | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/testcases/kernel/security/integrity/ima/src/ima_measure.c b/testcases/kernel/security/integrity/ima/src/ima_measure.c index dd6b1d0..0484c04 100644 --- a/testcases/kernel/security/integrity/ima/src/ima_measure.c +++ b/testcases/kernel/security/integrity/ima/src/ima_measure.c @@ -22,7 +22,7 @@ #include <fcntl.h> #include <string.h> #include <unistd.h> -//#include "config.h" +#include "config.h" #include "test.h" #if HAVE_OPENSSL_SHA_H #include <openssl/sha.h> @@ -33,6 +33,8 @@ char *TCID = "ima_measure"; int TST_TOTAL = 1; +static int verbose; + #define print_info(format, arg...) \ if (verbose) \ printf(format, ##arg) @@ -135,9 +137,8 @@ main(int argc, char *argv[]) FILE *fp; struct event template; u_int8_t pcr[SHA_DIGEST_LENGTH]; - int i, count = 0, len; + int i, count = 0; - int verbose = 0; int validate = 0; int verify = 0; diff --git a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh index 9bc4bf6..71391ae 100755 --- a/testcases/kernel/security/integrity/ima/tests/ima_setup.sh +++ b/testcases/kernel/security/integrity/ima/tests/ima_setup.sh @@ -85,7 +85,7 @@ setup() LTPIMA= trap "cleanup" 0 - if [ -z "$TMPDIR" ]; then + if [ -z "${TMPDIR:-}" ]; then LTPTMP=/tmp else LTPTMP=${TMPDIR} @@ -104,7 +104,7 @@ setup() # create the temporary directory used by this testcase LTPIMA=$LTPTMP/ima umask 077 - mkdir $LTPIMA > /dev/null 2>&1 || RC=$? + mkdir -p $LTPIMA > /dev/null 2>&1 || RC=$? if [ $RC -ne 0 ]; then tst_resm TBROK "Unable to create temporary directory" return $RC hooks/post-receive -- ltp |