Skip to contentSkip to conversation

Compilation Error Fixed in filecaps.

PATCH In review Sravan V Dodla 5 participants 7 messages Sep 24, 2010 – Oct 4, 2010 6 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Compilation Error Fixed in filecaps.

Hello,

I have been facing an compilation issue with the latest version of LTP. After some debugging I found out that the flag HAVE_SYS_CAPABILITY_H is not used and sys/capability.h is being included.
So here is the patch to get rid of this error.

c.c.orig renamed from c.c +0 -2
@@ -20,9 +20,7 @@
 
 
 #include <stdio.h>
-#if HAVE_SYS_CAPABILITY_H
 #include <sys/capability.h>
-#endif
 
 int main()
 {

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 3 lines · Sravan V Dodla

Hello,

I have been facing an compilation issue with the latest version of LTP. After some debugging I found out that the

I don't see that code in current ltp head. It checks HAVE_LIBCAP. What code are you looking at?

Quoted 19 lines

flag HAVE_SYS_CAPABILITY_H is not used and sys/capability.h is being included. So here is the patch to get rid of this error.

c.c.orig renamed from c.c +0 -3
@@ -20,9 +20,7 @@
 
 
 #include <stdio.h>
-#if HAVE_SYS_CAPABILITY_H
 #include <sys/capability.h>
-#endif
 
 int main()
 {
 
------------------------------------------------------------------------------
Quoted 8 lines

Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
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]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#8 lore raw

Serge Hallyn <[email protected]> wrote on 09/29/2010 07:40:51 PM:

Quoted 10 lines · sravan
Quoted 8 lines

Sorry for the confusion Serge.
I have taken the "c.c" file from the latest ltp release and found that it is not compiling.

The same file is not compiling in the earlier release of ltp also. To resolve the compilation issue I have added the following flag(HAVE_SYS_CAPABILITY_H).
The same flag is also used in

ltp-full-20100831/testcases/kernel/security/

Quoted 14 lines

filecaps/verify_caps_exec.c

Quoted 7 lines

file.

#if HAVE_SYS_CAPABILITY_H //Added by Sravan
#include <sys/capability.h>
#endif // Added by Sravan

Please let me know if this is the correct approach.

Well, the better approach would be to install the libcap-dev package (or whatever it is called on your distro) :) But so long as you're just getting your own compile working, whatever gets you a working build is fine.

Quoted 5 lines

What worries me, though, is the thought that the official 20100831 release has the wrong files in it! Can you follow up on that with Subrata? In particular, the c.c file is different from the one in ltp.git. Something is going very wrong!

Garret,

Did we miss/drop something during our migration from ltp-dev.git to ltp.git ?

Regards--
Subrata

Quoted 3 lines

thanks,
-serge

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#9 lore raw
Quoted 32 lines · On Wed, Sep 29, 2010 at 7:09 AM, Subrata Modak1 <[email protected]>…

Serge Hallyn <[email protected]> wrote on 09/29/2010 07:40:51 PM:

Quoted 10 lines · sravan
Quoted 8 lines

 Sorry for the confusion Serge.
I have taken the "c.c" file from the latest ltp release and found that it is not compiling.

The same file is not compiling in the earlier release of ltp also. To resolve the compilation issue I have added the following flag(HAVE_SYS_CAPABILITY_H).
The same flag is also used in

ltp-full-20100831/testcases/kernel/security/

Quoted 14 lines

filecaps/verify_caps_exec.c

Quoted 7 lines

file.

#if HAVE_SYS_CAPABILITY_H            //Added by Sravan #include <sys/capability.h>
#endif                                              // Added by Sravan

Please let me know if this is the correct approach.

Well, the better approach would be to install the libcap-dev package (or whatever it is called on your distro)  :)  But so long as you're just getting your own compile working, whatever gets you a working build is fine.

Quoted 5 lines

What worries me, though, is the thought that the official 20100831 release has the wrong files in it!  Can you follow up on that with Subrata?  In particular, the c.c file is different from the one in ltp.git.  Something is going very wrong!

Quoted 4 lines

Garret,

Did we miss/drop something during our migration from ltp-dev.git to ltp.git ?

No... I pushed all of the content from ltp-dev.git up to ltp.git.
Thanks,
-Garrett

------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized environment for deploying applications. Does it make network security easier or more difficult to achieve? Read this whitepaper to separate the two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#10 lore raw
Quoted 34 lines · Garrett Cooper
Quoted 32 lines · On Wed, Sep 29, 2010 at 7:09 AM, Subrata Modak1 <[email protected]>…

Serge Hallyn <[email protected]> wrote on 09/29/2010 07:40:51 PM:

Quoted 10 lines · sravan
Quoted 8 lines

 Sorry for the confusion Serge.
I have taken the "c.c" file from the latest ltp release and found that it is not compiling.

The same file is not compiling in the earlier release of ltp also. To resolve the compilation issue I have added the following flag(HAVE_SYS_CAPABILITY_H).
The same flag is also used in

ltp-full-20100831/testcases/kernel/security/

Quoted 19 lines

filecaps/verify_caps_exec.c

Quoted 7 lines

file.

#if HAVE_SYS_CAPABILITY_H            //Added by Sravan #include <sys/capability.h>
#endif                                              // Added by Sravan

Please let me know if this is the correct approach.

Well, the better approach would be to install the libcap-dev package (or whatever it is called on your distro)  :)  But so long as you're just getting your own compile working, whatever gets you a working build is fine.

What worries me, though, is the thought that the official 20100831 release has the wrong files in it!  Can you follow up on that with Subrata?  In particular, the c.c file is different from the one in ltp.git.  Something is going very wrong!

Quoted 6 lines
Quoted 4 lines

Garret,

Did we miss/drop something during our migration from ltp-dev.git to ltp.git ?

   No... I pushed all of the content from ltp-dev.git up to ltp.git.

    BTW...
$ git status c.c
# On branch master
nothing to commit (working directory clean)
$ diff ~/Downloads/ltp-full-20100831/testcases/kernel/security/filecaps/c.c
  c.c
$ echo $?
0

So I'm not sure what Serge was looking at...
Thanks,
-Garrett

------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized environment for deploying applications. Does it make network security easier or more difficult to achieve? Read this whitepaper to separate the two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#11 lore raw

Hi Sravan,

1) File c.c is present in both git and the last August LTP release as well
2) File c.c is building well on my Fedora 13 PPC64 Box:

# uname -a
Linux 2.6.35.4 #2 SMP Tue Sep 28 16:07:27 IST 2010 ppc64 ppc64 ppc64
GNU/Linux
# cat /etc/issue
Fedora release 13 (Goddard)
Kernel \r on an \m (\l)
# which automake
/usr/bin/automake
# /usr/bin/automake --version
automake (GNU automake) 1.11.1
# ls
-l /root/LTP_AUGUST_2010_RELEASE/ltp-full-20100831/testcases/kernel/security/filecaps/c*
-rwxrwxr-x. 1 root root 8171 Sep 29
20:09 /root/LTP_AUGUST_2010_RELEASE/ltp-full-20100831/testcases/kernel/security/filecaps/c
-rw-r--r--. 1 root root 1987 Sep 14
16:34 /root/LTP_AUGUST_2010_RELEASE/ltp-full-20100831/testcases/kernel/security/filecaps/c.c
-rwxrwxr-x. 1 root root 9235 Sep 29 
# ls -l /opt/ltp/testcases/bin/c
-rwxrwxr-x. 1 root root 8171 Sep 29 20:24 /opt/ltp/testcases/bin/c
# ./runltp -f filecaps
Running tests.......
<<<test_start>>>
tag=Filecaps stime=1286194213
cmdline="filecapstest.sh"
contacts=""
analysis=exit
<<<test_output>>>
incrementing stop
Running in:
cap_sys_admin tests
filecaps    1  TPASS  :  could not set capabilities as non-root

testing for correct caps
filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO :
caps are =

filecaps 0 TINFO : 0

filecaps 0 TINFO : 1

filecaps 0 TINFO : 2

filecaps 0 TINFO : 3

filecaps 0 TINFO : 4

filecaps 0 TINFO : 5

filecaps 0 TINFO : 6

filecaps 0 TINFO : 7

filecaps 0 TINFO : 8

filecaps 0 TINFO : 9

filecaps 0 TINFO : 10

filecaps 0 TINFO : 11

filecaps 0 TINFO : 12

filecaps 0 TINFO : 13

filecaps 0 TINFO : 14

filecaps 0 TINFO : 15

filecaps 0 TINFO : 16

filecaps 0 TINFO : 17

filecaps 0 TINFO : 18

filecaps 0 TINFO : 19

filecaps 0 TINFO : 20

filecaps 0 TINFO : 21

filecaps 0 TINFO : 22

filecaps 0 TINFO : 23

filecaps 0 TINFO : 24

filecaps 0 TINFO : 25

filecaps 0 TINFO : 26

filecaps 0 TINFO : 27

filecaps 0 TINFO : 28

filecaps 0 TINFO : 29

filecaps 0 TINFO : 30

filecaps 0 TINFO : 31

filecaps 0 TINFO : 32

filecaps 0 TINFO : 33

filecaps 1 TPASS : All tests passed

testing for correct pI checks

filecaps    0  TINFO  :  start
filecaps    0  TINFO  :  =ep
filecaps    0  TINFO  :  after raising all caps
filecaps    0  TINFO  :  =eip
filecaps    0  TINFO  :  after first drop cap_sys_admin
filecaps    0  TINFO  :  =eip cap_sys_admin-eip
filecaps    0  TINFO  :  after first raise cap_sys_admin
filecaps    0  TINFO  :  =eip cap_sys_admin-ep
filecaps    0  TINFO  :  after drop cappset
filecaps    0  TINFO  :  =ip cap_sys_admin-p
filecaps    0  TINFO  :  after second drop cap_sys_admin
filecaps    0  TINFO  :  =eip cap_setpcap-e cap_sys_admin-eip
filecaps    0  TINFO  :  final
filecaps    0  TINFO  :  =eip cap_setpcap-e cap_sys_admin-eip
filecaps    1  TPASS  :  pI is properly capped

<<<execution_status>>>
initiation_status="ok"
duration=0 termination_type=exited termination_id=0 corefile=no cutime=0 cstime=1
<<<test_end>>>
INFO: ltp-pan reported all tests PASS
LTP Version: LTP-20100831

       ###############################################################"
        
            Done executing testcases."
            LTP Version:  LTP-20100831
       ###############################################################"

Regards--
Subrata

Quoted 56 lines · Garrett Cooper
Quoted 34 lines · Garrett Cooper
Quoted 32 lines · On Wed, Sep 29, 2010 at 7:09 AM, Subrata Modak1 <[email protected]>…

Serge Hallyn <[email protected]> wrote on 09/29/2010 07:40:51 PM:

Quoted 10 lines · sravan
Quoted 8 lines

Sorry for the confusion Serge.
I have taken the "c.c" file from the latest ltp release and found that it is not compiling.

The same file is not compiling in the earlier release of ltp also. To resolve the compilation issue I have added the following flag(HAVE_SYS_CAPABILITY_H).
The same flag is also used in

ltp-full-20100831/testcases/kernel/security/

Quoted 19 lines

filecaps/verify_caps_exec.c

Quoted 7 lines

file.

#if HAVE_SYS_CAPABILITY_H //Added by Sravan
#include <sys/capability.h>
#endif // Added by Sravan

Please let me know if this is the correct approach.

Well, the better approach would be to install the libcap-dev package (or whatever it is called on your distro) :) But so long as you're just getting your own compile working, whatever gets you a working build is fine.

What worries me, though, is the thought that the official 20100831 release has the wrong files in it! Can you follow up on that with Subrata? In particular, the c.c file is different from the one in ltp.git. Something is going very wrong!

Quoted 6 lines
Quoted 4 lines

Garret,

Did we miss/drop something during our migration from ltp-dev.git to ltp.git ?

No... I pushed all of the content from ltp-dev.git up to ltp.git.

    BTW...
$ git status c.c
# On branch master
nothing to commit (working directory clean)
$ diff ~/Downloads/ltp-full-20100831/testcases/kernel/security/filecaps/c.c
  c.c
$ echo $?
0

So I'm not sure what Serge was looking at...
Thanks,
-Garrett

Quoted 10 lines

------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized environment for deploying applications. Does it make network security easier or more difficult to achieve? Read this whitepaper to separate the two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized environment for deploying applications. Does it make network security easier or more difficult to achieve? Read this whitepaper to separate the two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#12 lore raw
In reply to Garrett Cooper
Quoted 1 line · Garrett Cooper

So I'm not sure what Serge was looking at...

Not me.

-serge

------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized environment for deploying applications. Does it make network security easier or more difficult to achieve? Read this whitepaper to separate the two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list