fix obvious compilation problems in cap_bounds
PATCH 1/1 fix obvious compilation problems in cap_bounds
Hi!
Following patch fixes obvious problems with cap_bounds compilation
* CAP_LAST_CAP is defined in linux/capability.h => include it
* remove int errno; definition
* move #ifdef HAVE_SYS_CAPABILITY_H after int main(int argc, char *argv[]) in check_pe.c
* small typos and coding style
Signature · 2 lines
Cyril Hrubis [email protected]
testcases/kernel/security/cap_bound/cap_bounds_r.c +1 -2
@@ -29,14 +29,13 @@#if HAVE_SYS_CAPABILITY_H #include <sys/capability.h> #endif +#include <linux/capability.h> #include <sys/prctl.h> #include <test.h> char *TCID ="cap_bounds_r" ;int TST_TOTAL =1 ; -int errno; -int main (int argc,char *argv[]) {#if HAVE_SYS_CAPABILITY_H
testcases/kernel/security/cap_bound/cap_bounds_rw.c +4 -5
@@ -28,20 +28,19 @@#if HAVE_SYS_CAPABILITY_H #include <sys/capability.h> #endif +#include <linux/capability.h> #include <sys/prctl.h> #include <test.h> char *TCID ="cap_bounds_rw" ;int TST_TOTAL =1 ; -int errno; -int check_remaining_caps (int lastdropped) {int i;int ret; -for (i=0 ; i <= lastdropped; i++) { +for (i =0 ; i <= lastdropped; i++) {#if HAVE_DECL_PR_CAPBSET_READ ret =prctl (PR_CAPBSET_READ , i);#else
@@ -57,7 +56,7 @@ int check_remaining_caps(int lastdropped)return i; } } -for (; i<=CAP_LAST_CAP ; i++) { +for (; i <=CAP_LAST_CAP ; i++) {#if HAVE_DECL_PR_CAPBSET_READ ret =prctl (PR_CAPBSET_READ , i);#else
@@ -108,7 +107,7 @@ int main(int argc, char *argv[])tst_resm (TINFO ," %d is should not exist\n" ,max (INSANE ,CAP_LAST_CAP +1 ));tst_exit (); } -for (i=0 ; i<=CAP_LAST_CAP ; i++) { +for (i =0 ; i <=CAP_LAST_CAP ; i++) {#if HAVE_DECL_PR_CAPBSET_DROP ret =prctl (PR_CAPBSET_DROP , i);#else
testcases/kernel/security/cap_bound/cap_bset_inh_bounds.c +0 -2
@@ -37,8 +37,6 @@char *TCID ="cap_bounds_r" ;int TST_TOTAL =2 ; -int errno; -int main (int argc,char *argv[]) {#if HAVE_SYS_CAPABILITY_H
testcases/kernel/security/cap_bound/check_pe.c +3 -5
@@ -38,12 +38,10 @@char *TCID ="check_pe" ;int TST_TOTAL =1 ; -int errno; - -#if HAVE_SYS_CAPABILITY_H -#ifdef HAVE_LIBCAPint main (int argc,char *argv[]) { +#ifdef HAVE_SYS_CAPABILITY_H +#ifdef HAVE_LIBCAP int ret =1 ;cap_flag_value_t f;cap_t cur;
@@ -72,7 +70,7 @@ int main(int argc, char *argv[])tst_resm (TPASS ,"cap is in pE\n" );tst_exit (); } -tst_resm (TFAIL ,"Cap is not in pE\n" ); +tst_resm (TFAIL ,"cap is not in pE\n" );tst_exit (); }if (f ==CAP_CLEAR ) {
testcases/kernel/security/cap_bound/dummy.c +1 -1
@@ -5,7 +5,7 @@#include <sys/capability.h> #endif -int main () +int main (void ) {#if HAVE_SYS_CAPABILITY_H #ifdef HAVE_LIBCAP
testcases/kernel/security/cap_bound/exec_with_inh.c +0 -2
@@ -37,8 +37,6 @@char *TCID ="exec_with_inh" ;int TST_TOTAL =1 ; -int errno; -int main (int argc,char *argv[]) {#if HAVE_SYS_CAPABILITY_H
testcases/kernel/security/cap_bound/exec_without_inh.c +0 -2
@@ -37,8 +37,6 @@char *TCID ="exec_without_inh" ;int TST_TOTAL =1 ; -int errno; -int main (int argc,char *argv[]) {#if HAVE_SYS_CAPABILITY_H
------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 9 lines
Quoted 9 lines
Following patch fixes obvious problems with
cap_boundscompilation*
CAP_LAST_CAPis defined inlinux/capability.h=> include it* remove int errno; definition
* move #ifdef
HAVE_SYS_CAPABILITY_Hafter intmain(int argc, char *argv[])incheck_pe.c
Quoted 6 lines
Quoted 1 line
* small typos and coding style
Hi Cyril!
Quick question -- why doesn'tsys/capability.hbuild onlinux/capability.h(in particular what OS did you run into this issue on)?
You are right, the problem is that HAVE_SYS_CAPABILITY_H is not in config.h even when libcap-devel is installed and headers are found (there is only #define HAVE_LIBCAP 1).
Signature · 13 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi!
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Following patch fixes obvious problems with
cap_boundscompilation*
CAP_LAST_CAPis defined inlinux/capability.h=> include it* remove int errno; definition
* move #ifdef
HAVE_SYS_CAPABILITY_Hafter intmain(int argc, char *argv[])incheck_pe.c* small typos and coding style
Quoted 9 lines
Quoted 4 lines
Hi Cyril!
Quick question -- why doesn'tsys/capability.hbuild onlinux/capability.h(in particular what OS did you run into this issue on)?You are right, the problem is that
HAVE_SYS_CAPABILITY_His not inconfig.heven when libcap-devel is installed and headers are found (there is only #defineHAVE_LIBCAP1).
Hmm, adding sys/capability.h into AC_CHECK_HEADERS() in configure.ac seem to fixed this. Still I have no idea why AC_CHECK_HEADER() in m4/ltp-cap.m4 hasn't exported HAVE_SYS_CAPABILITY_H.
Signature · 13 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 21 lines
Quoted 21 lines
Quoted 20 lines
Quoted 9 lines
Quoted 9 lines
Following patch fixes obvious problems with
cap_boundscompilation*
CAP_LAST_CAPis defined inlinux/capability.h=> include it* remove int errno; definition
* move #ifdef
HAVE_SYS_CAPABILITY_Hafter intmain(int argc, char *argv[])incheck_pe.cQuoted 6 lines
Quoted 1 line
* small typos and coding style
Hi Cyril!
Quick question -- why doesn'tsys/capability.hbuild onlinux/capability.h(in particular what OS did you run into this issue on)?You are right, the problem is that
HAVE_SYS_CAPABILITY_His not inconfig.heven when libcap-devel is installed and headers are found (there is only #defineHAVE_LIBCAP1).
Quoted 6 lines
Quoted 3 lines
Hmm, adding
sys/capability.hintoAC_CHECK_HEADERS()in configure.ac seem to fixed this. Still I have no idea whyAC_CHECK_HEADER()in m4/ltp-cap.m4 hasn't exportedHAVE_SYS_CAPABILITY_H.Probably because I forgot to remove the square brackets; give the
patch attached a shot and let me know how it goes...
Nope, it looks like AC_CHECK_HEADER() does not set HAVE_* at all(1). So we need to change AC_HECK_HEADER() to AC_CHECK_HEADERS() in m4/ltp-cap.m4.
1) http://www.gnu.org/software/hello/manual/autoconf/Generic-Headers.html
Signature · 13 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 25 lines
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Following patch fixes obvious problems with
cap_boundscompilation*
CAP_LAST_CAPis defined inlinux/capability.h=> include it* remove int errno; definition
* move #ifdef
HAVE_SYS_CAPABILITY_Hafter intmain(int argc, char *argv[])incheck_pe.c* small typos and coding style
Quoted 9 lines
Quoted 4 lines
Hi Cyril!
Quick question -- why doesn'tsys/capability.hbuild onlinux/capability.h(in particular what OS did you run into this issue on)?You are right, the problem is that
HAVE_SYS_CAPABILITY_His not inconfig.heven when libcap-devel is installed and headers are found (there is only #defineHAVE_LIBCAP1).Hmm, adding
sys/capability.hintoAC_CHECK_HEADERS()in configure.ac seem to fixed this. Still I have no idea whyAC_CHECK_HEADER()in m4/ltp-cap.m4 hasn't exportedHAVE_SYS_CAPABILITY_H.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Probably because I forgot to remove the square brackets; give the patch attached a shot and let me know how it goes...
Nope, it looks like
AC_CHECK_HEADER()does not set HAVE_* at all(1). So we need to changeAC_HECK_HEADER()toAC_CHECK_HEADERS()in m4/ltp-cap.m4.That's kind of lame :/... Could you try this patch instead please?
Yes, this works regardless if there are square braces around sys/capability.h or not.
Signature · 13 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 27 lines
Quoted 16 lines
Quoted 16 lines
Quoted 15 lines
Quoted 10 lines
Following patch fixes obvious problems with
cap_boundscompilation*
CAP_LAST_CAPis defined inlinux/capability.h=> include it* remove int errno; definition
* move #ifdef
HAVE_SYS_CAPABILITY_Hafter intmain(int argc, char *argv[])incheck_pe.c* small typos and coding style
Hi Cyril!
Quick question -- why doesn'tsys/capability.hbuild onlinux/capability.h(in particular what OS did you run into this issue on)?Quoted 8 lines
Quoted 4 lines
You are right, the problem is that
HAVE_SYS_CAPABILITY_His not inconfig.heven when libcap-devel is installed and headers are found (there is only #defineHAVE_LIBCAP1).Hmm, adding
sys/capability.hintoAC_CHECK_HEADERS()in configure.ac seem to fixed this. Still I have no idea whyAC_CHECK_HEADER()in m4/ltp-cap.m4 hasn't exportedHAVE_SYS_CAPABILITY_H.Probably because I forgot to remove the square brackets; give the patch attached a shot and let me know how it goes...
Quoted 9 lines
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Nope, it looks like
AC_CHECK_HEADER()does not set HAVE_* at all(1). So we need to changeAC_HECK_HEADER()toAC_CHECK_HEADERS()in m4/ltp-cap.m4.That's kind of lame :/... Could you try this patch instead please?
Yes, this works regardless if there are square braces around
sys/capability.hor not.
Do you want me to create new patch (for the original issue) without #include <linux/capability.h>?
Signature · 13 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list