Skip to contentSkip to conversation

make filecaps tests succeed

PATCH In review Serge E. Hallyn 3 participants 3 messages May 6, 2010 – May 7, 2010

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 make filecaps tests succeed

(Garrett I was going to add your ack, but wasn't absolutely sure whether you meant it should apply to the whole thing or not)

Most of these are belated cleanup after the move to using /opt/ltp. But come on, replacing 'return' with tst_exit(), are you just trying to mess with my head?

Changelog:
may 4: address Garrett's feedback
1. single return 0 in print_caps.c
2. use $TMP if defined for location of caps_fifo
3. use tst_brkm in place of tst_resm.
may 5: address Garrett's comment:
don't add 1 to null pointer and then check for 1

---
 testcases/kernel/security/filecaps/filecapstest.sh |   10 +++-
 testcases/kernel/security/filecaps/print_caps.c    |    5 +-
 .../kernel/security/filecaps/verify_caps_exec.c    |   51 ++++++++------------
 3 files changed, 30 insertions(+), 36 deletions(-)
testcases/kernel/security/filecaps/filecapstest.sh +7 -3
index 43582dc..8e2ba11 100755
@@ -22,8 +22,12 @@
 echo "Running in:"
 #rm -f print_caps
 #cp $LTPROOT/testcases/bin/print_caps .
-mkfifo caps_fifo
-chmod 777 caps_fifo
+#FIFOFILE="$LTPROOT/testcases/bin/caps_fifo"
+TMP=${TMP:=/tmp}
+FIFOFILE="$TMP/caps_fifo"
+rm -f $FIFOFILE
+mkfifo $FIFOFILE
+chmod 777 $FIFOFILE
 exit_code=0
 echo "cap_sys_admin tests"
 verify_caps_exec 0
@@ -46,5 +50,5 @@ if [ $tmp -ne 0 ]; then
 	exit_code=$tmp
 fi
 
-unlink caps_fifo
+unlink $FIFOFILE
 exit $exit_code
testcases/kernel/security/filecaps/print_caps.c +2 -3
index f0e9bce..1c3fc1b 100644
@@ -36,7 +36,7 @@
 #include <sys/capability.h>
 #endif
 
-#define FIFOFILE "caps_fifo"
+#define FIFOFILE "/tmp/caps_fifo"
 
 int main(int argc, char *argv[])
 {
@@ -65,7 +65,6 @@ int main(int argc, char *argv[])
 	close(fd);
 
 	cap_free(cap);
-#else
-	return 0;
 #endif
+	return 0;
 }
testcases/kernel/security/filecaps/verify_caps_exec.c +21 -30

113 lines not on this page · raw message

Signature · 8 lines
1.6.0.6


------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Acked-by on v2 1/1
#1 lore raw
Quoted 15 lines · Serge E. Hallyn

(Garrett I was going to add your ack, but wasn't absolutely sure whether you meant it should apply to the whole thing or not)

Most of these are belated cleanup after the move to using /opt/ltp. But come on, replacing 'return' with tst_exit(), are you just trying to mess with my head?

Changelog:
 may 4: address Garrett's feedback
 1. single return 0 in print_caps.c
 2. use $TMP if defined for location of caps_fifo
 3. use tst_brkm in place of tst_resm.
 may 5: address Garrett's comment:
 don't add 1 to null pointer and then check for 1

Quoted 1 line

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
Quoted 16 lines · Garrett Cooper
Quoted 15 lines · Serge E. Hallyn

(Garrett I was going to add your ack, but wasn't absolutely sure whether you meant it should apply to the whole thing or not)

Most of these are belated cleanup after the move to using /opt/ltp. But come on, replacing 'return' with tst_exit(), are you just trying to mess with my head?

Changelog:
may 4: address Garrett's feedback
1. single return 0 in print_caps.c
2. use $TMP if defined for location of caps_fifo
3. use tst_brkm in place of tst_resm.
may 5: address Garrett's comment:
don't add 1 to null pointer and then check for 1

Quoted 3 lines
Quoted 1 line

Thanks. Checked in just now.

Regards--
Subrata

Quoted 6 lines

------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list