> Could you try the following patch?
> 
> thanks,
> -serge
> 
> >From 8637f84892c139608f530b3aa7e69c67802ebafb Mon Sep 17 00:00:00 2001
> From: Serge E. Hallyn <[EMAIL PROTECTED]>
> Date: Mon, 4 Feb 2008 10:56:53 -0500
> Subject: [PATCH 1/1] Detect lack of xattr headers
> 
> Don't compile filecap tests if we dont' have xattr headers.
> 
> Signed-off-by: Serge E. Hallyn <[EMAIL PROTECTED]>
> ---
>  testcases/kernel/security/filecaps/Makefile        |    2 +-
>  testcases/kernel/security/filecaps/check_xattr.c   |    9 +++++++++
>  .../kernel/security/filecaps/checkforlibcap.sh     |    9 +++++++++
>  3 files changed, 19 insertions(+), 1 deletions(-)
>  create mode 100644 testcases/kernel/security/filecaps/check_xattr.c
> 
> diff --git a/testcases/kernel/security/filecaps/Makefile 
> b/testcases/kernel/security/filecaps/Makefile
> index 4d49896..4896708 100644
> --- a/testcases/kernel/security/filecaps/Makefile
> +++ b/testcases/kernel/security/filecaps/Makefile
> @@ -12,7 +12,7 @@ all: $(TARGETS)
>       gcc -o checkforlibcap gotlibcap.c
>  else
>  all:
> -     @echo "setcap not installed.  Please install libcap from"; echo 
> "ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/libcap2";; echo 
> "Then make clean in ltp or ltp/testcases/kernel/security/filecaps, and 
> recompile ltp."
> +     @echo "setcap or xattr headers not installed.  Please install libcap 
> from"; echo 
> "ftp://ftp.kernel.org/pub/linux/libs/security/linux-privs/libcap2";; echo 
> "Then make clean in ltp or ltp/testcases/kernel/security/filecaps, and 
> recompile ltp."
>       gcc -o checkforlibcap nolibcap.c
>  TARGETS =
>  endif
> diff --git a/testcases/kernel/security/filecaps/check_xattr.c 
> b/testcases/kernel/security/filecaps/check_xattr.c
> new file mode 100644
> index 0000000..55c6421
> --- /dev/null
> +++ b/testcases/kernel/security/filecaps/check_xattr.c
> @@ -0,0 +1,9 @@
> +#include <stdio.h>
> +#include <sys/capability.h>
> +#include <attr/xattr.h>
> +
> +int main()
> +{
> +     printf("Hello, world\n");
> +     return 0;
> +}

I was wondering if the real intention is to find the existence of
attr/xattr.h file, can´t we do that in some other way, rather than
compiling this file (as depicted below), (compilation fails if #include
<attr/xattr.h> doesn´t exist) ?

--Subrata

> diff --git a/testcases/kernel/security/filecaps/checkforlibcap.sh 
> b/testcases/kernel/security/filecaps/checkforlibcap.sh
> index e41ecd4..a43dd1a 100755
> --- a/testcases/kernel/security/filecaps/checkforlibcap.sh
> +++ b/testcases/kernel/security/filecaps/checkforlibcap.sh
> @@ -12,6 +12,15 @@ if [ $ret -eq 0 ]; then
>       ret=$?
>  fi
> 
> +if [ $ret -eq 0 ]; then
> +     #also test for xattr
> +     gcc -o check_xattr check_xattr.c 
> +     ret=$?
> +     if [ $ret -ne 0 ]; then
> +             echo "Please install xattr headers"
> +     fi
> +fi
> +
>  if [ $ret -ne 0 ]; then
>       if [ $yesno -eq 1 ]; then
>               echo no


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to