All of lore.kernel.org
 help / color / mirror / Atom feed
From: Athira <atrajeev@linux.vnet.ibm.com>
To: yanegomi@gmail.com, ltp-list@lists.sourceforge.net
Subject: [LTP] Filecaps tests not getting built along with ltp
Date: Mon, 30 Jan 2012 10:47:56 +0530	[thread overview]
Message-ID: <4F262804.9020508@linux.vnet.ibm.com> (raw)

Hi Garrett,

There are two commits for filecaps test in ltp as below:

1.
http://ltp.git.sourceforge.net/git/gitweb.cgi?p=ltp/ltp.git;a=commitdiff;h=4f71cae2e9c35b08626626aa9a5a063cb2972f64 

2.
http://ltp.git.sourceforge.net/git/gitweb.cgi?p=ltp/ltp.git;a=commitdiff;h=183c6e447406baa67c4dc109c060bd019ed7e850 


I am not able to get filecpas tests built along with ltp applying these 
commits.

I didnt understand the change from "setcap" to "capset"
for AC_CHECK_PROG in the below diff in the first commit:
http://ltp.git.sourceforge.net/git/gitweb.cgi?p=ltp/ltp.git;a=commitdiff;h=4f71cae2e9c35b08626626aa9a5a063cb2972f64 


diff --git a/m4/ltp-cap.m4 b/m4/ltp-cap.m4
index caa436f..ede30bb 100644 (file)
--- a/m4/ltp-cap.m4
+++ b/m4/ltp-cap.m4
@@ -27,8 +27,12 @@ AH_TEMPLATE(HAVE_LIBCAP,
  [Define to 1 if you have libcap-2 installed.])
  AC_CHECK_HEADERS(sys/capability.h,[
         LTP_CAPABILITY_SUPPORT=yes
-       AC_CHECK_LIB(cap,cap_compare,[AC_DEFINE(HAVE_LIBCAP) 
CAP_LIBS="-lcap"],
[CAP_LIBS=""])
-       AC_CHECK_PROG(HAVE_SETCAP,setcap,setcap,false)
-])]
-AC_SUBST(CAP_LIBS)
-)
+       AC_CHECK_LIB(cap,cap_compare,[AC_DEFINE(HAVE_LIBCAP) 
cap_libs="-lcap"])
+       AC_CHECK_PROG(HAVE_SETCAP,capset,[have_capset="yes"])
+])
+if test "x$have_capset" != xyes; then
+       have_capset=no
+fi
+AC_SUBST(CAP_LIBS,$cap_libs)
+AC_SUBST(HAVE_CAPSET,$have_capset)
+])


The program to set file capablities is "setcap",
whereas capset is to set the capabilities of thread.

The expansion of macro AC_CHECK_PROG:
Macro: AC_CHECK_PROG (variable, prog-to-check-for, value-if-found,
[value-if-not-found], [path], [reject])
     Check whether program prog-to-check-for exists in PATH. If it is 
found, set
variable to value-if-found, otherwise to value-if-not-found, if given.

There is no program "capset" in $PATH, instead setcap exists.
Was it a mistake? Would like to know the reason for that change.

Also in testcases/kernel/security/Makefile

--- a/testcases/kernel/security/Makefile
+++ b/testcases/kernel/security/Makefile
@@ -29,7 +29,7 @@ include       $(top_srcdir)/include/mk/env_pre.mk
  ifeq ($(strip $(CAP_LIBS)),)
  FILTER_OUT_DIRS                := cap_bound filecaps securebits
  endif
-ifneq ($(HAVE_SETCAP),yes)
+ifeq ($(strip $(SETCAP)),)
  FILTER_OUT_DIRS                += filecaps
  endif
  ifneq ($(HAVE_SECUREBITS),yes)


There is no variable named "SETCAP" in the configure script,
instead it is CAPSET, which comes from the macro:
"AC_CHECK_PROG(CAPSET,capset,capset)"
in m4/ltp-cap.m4.
So I feel the variable in Makefile should be CAPSET.

Because of this, the filecaps test is not getting built along with ltp.

I am able to get the filecaps test built along with ltp by making 
changes below,
running "autoconf" to create configure script and then built the ltp.

--- testcases/kernel/security/Makefile.org    2011-12-28 
14:48:44.376719618 +0530
+++ testcases/kernel/security/Makefile    2011-12-28 14:47:55.220811859 
+0530
@@ -29,7 +29,7 @@ include    $(top_srcdir)/include/mk/env_pre
  ifeq ($(strip $(CAP_LIBS)),)
  FILTER_OUT_DIRS        := cap_bound filecaps securebits
  endif
-ifeq ($(strip $(SETCAP)),)
+ifeq ($(strip $(CAPSET)),)
  FILTER_OUT_DIRS        += filecaps
  endif
  ifneq ($(HAVE_SECUREBITS),yes)


--- m4/ltp-cap.m4.org    2011-12-28 14:46:59.797917296 +0530
+++ m4/ltp-cap.m4    2011-12-28 14:47:17.353883733 +0530
@@ -29,7 +29,7 @@ AH_TEMPLATE(HAVE_LIBCAP,
  AC_CHECK_HEADERS([sys/capability.h],[capability_header_prefix="sys"])
  if test "x$capability_header_prefix" != x; then
      AC_CHECK_LIB(cap,cap_compare,[cap_libs="-lcap"])
-    AC_CHECK_PROG(CAPSET,capset,capset)
+    AC_CHECK_PROG(CAPSET,setcap,capset)
  fi
  if test "x$cap_libs" != x; then
      AC_DEFINE(HAVE_LIBCAP)


Please correct if I am wrong.

Thanks,
Athira Rajeev


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2012-01-30  5:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30  5:17 Athira [this message]
2012-02-10 12:12 ` [LTP] Filecaps tests not getting built along with ltp Cyril Hrubis

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=4F262804.9020508@linux.vnet.ibm.com \
    --to=atrajeev@linux.vnet.ibm.com \
    --cc=ltp-list@lists.sourceforge.net \
    --cc=yanegomi@gmail.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.