* [LTP] [PATCH] Fix Security/Filecaps Build failure.
@ 2009-07-03 10:35 Sachin Sant
2009-07-06 15:50 ` Subrata Modak
0 siblings, 1 reply; 2+ messages in thread
From: Sachin Sant @ 2009-07-03 10:35 UTC (permalink / raw)
To: serue; +Cc: ltp-list
[-- Attachment #1: Type: text/plain, Size: 175 bytes --]
Fix Filecaps build break.
inh_capped.c:70: error: too many arguments to function ‘tst_exit’
Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
---
thanks
-Sachin
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fix-june-ltp-filecaps-build-break.patch --]
[-- Type: text/x-patch; name="fix-june-ltp-filecaps-build-break.patch", Size: 4138 bytes --]
Fix Filecaps build break.
inh_capped.c:70: error: too many arguments to function ‘tst_exit’
Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
---
diff -Naurp a/testcases/kernel/security/filecaps/inh_capped.c b/testcases/kernel/security/filecaps/inh_capped.c
--- a/testcases/kernel/security/filecaps/inh_capped.c 2008-01-23 19:15:04.000000000 +0530
+++ b/testcases/kernel/security/filecaps/inh_capped.c 2009-07-03 15:21:02.000000000 +0530
@@ -67,14 +67,14 @@ int main()
debug_print_caps("after raising all caps");
if (ret) {
tst_resm(TFAIL, "failed to raise all caps");
- tst_exit(ret);
+ tst_exit();
}
ret = set_caps_from_text("all=iep cap_sys_admin-iep");
debug_print_caps("after first drop cap_sys_admin");
if (ret) {
tst_resm(TFAIL, "failed to drop capsysadmin from pI");
- tst_exit(ret);
+ tst_exit();
}
/* we can't regain cap_sys_admin in pE or pP, only pI */
@@ -82,14 +82,14 @@ int main()
debug_print_caps("after first raise cap_sys_admin");
if (ret) {
tst_resm(TFAIL, "failed to raise capsysadmin in pI");
- tst_exit(ret);
+ tst_exit();
}
ret = set_caps_from_text("all=ip cap_setpcap-e+ip cap_sys_admin+i-ep");
debug_print_caps("after drop cappset");
if (ret) {
tst_resm(TFAIL, "failed to drop cappset from pE");
- tst_exit(ret);
+ tst_exit();
}
ret = set_caps_from_text("all=iep cap_sys_admin-iep cap_setpcap-e+ip");
@@ -97,17 +97,17 @@ int main()
if (ret) {
tst_resm(TFAIL, "failed to drop capsysadmin from pI "
"after dropping cappset from pE");
- tst_exit(ret);
+ tst_exit();
}
ret = set_caps_from_text("all=iep cap_sys_admin-ep+i cap_setpcap-e+ip");
debug_print_caps("final");
if (ret) {
tst_resm(TPASS, "pI is properly capped\n");
- tst_exit(0);
+ tst_exit();
}
tst_resm(TFAIL, "succeeded raising capsysadmin in pI "
"without having setpcap");
- tst_exit(ret);
+ tst_exit();
}
diff -Naurp a/testcases/kernel/security/filecaps/verify_caps_exec.c b/testcases/kernel/security/filecaps/verify_caps_exec.c
--- a/testcases/kernel/security/filecaps/verify_caps_exec.c 2008-09-30 15:00:56.000000000 +0530
+++ b/testcases/kernel/security/filecaps/verify_caps_exec.c 2009-07-03 15:21:38.000000000 +0530
@@ -54,7 +54,7 @@ void usage(char *me)
tst_resm(TFAIL, "Usage: %s <0|1> [arg]\n", me);
tst_resm(TINFO, " 0: set file caps without privilege\n");
tst_resm(TINFO, " 1: test that file caps are set correctly on exec\n");
- tst_exit(1);
+ tst_exit();
}
#define DROP_PERMS 0
@@ -79,7 +79,7 @@ int drop_root(int keep_perms)
if (ret) {
perror("setresuid");
tst_resm(TFAIL, "Error dropping root privs\n");
- tst_exit(4);
+ tst_exit();
}
if (keep_perms) {
cap_t cap = cap_from_text("=eip");
@@ -123,7 +123,7 @@ void create_fifo(void)
if (ret == -1 && errno != EEXIST) {
perror("mkfifo");
tst_resm(TFAIL, "failed creating %s\n", FIFOFILE);
- tst_exit(1);
+ tst_exit();
}
}
@@ -145,7 +145,7 @@ void read_from_fifo(char *buf)
if (fd < 0) {
perror("open");
tst_resm(TFAIL, "Failed opening fifo\n");
- tst_exit(1);
+ tst_exit();
}
read(fd, buf, 199);
close(fd);
@@ -164,7 +164,7 @@ int fork_drop_and_exec(int keepperms, ca
if (pid < 0) {
perror("fork");
tst_resm(TFAIL, "%s: failed fork\n", __FUNCTION__);
- tst_exit(1);
+ tst_exit();
}
if (pid == 0) {
drop_root(keepperms);
@@ -177,7 +177,7 @@ int fork_drop_and_exec(int keepperms, ca
snprintf(buf, 200, "failed to run as %s\n", capstxt);
cap_free(capstxt);
write_to_fifo(buf);
- tst_exit(1);
+ tst_exit();
} else {
p = buf;
while (1) {
@@ -192,7 +192,7 @@ int fork_drop_and_exec(int keepperms, ca
p = index(buf, '.')+1;
if (p==(char *)1) {
tst_resm(TFAIL, "got a bad message from print_caps\n");
- tst_exit(1);
+ tst_exit();
}
actual_caps = cap_from_text(p);
if (cap_compare(actual_caps, expected_caps) != 0) {
@@ -396,5 +396,5 @@ int main(int argc, char *argv[])
default: usage(argv[0]);
}
- tst_exit(ret);
+ tst_exit();
}
[-- Attachment #3: Type: text/plain, Size: 79 bytes --]
------------------------------------------------------------------------------
[-- Attachment #4: Type: text/plain, Size: 155 bytes --]
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-07-06 15:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-03 10:35 [LTP] [PATCH] Fix Security/Filecaps Build failure Sachin Sant
2009-07-06 15:50 ` Subrata Modak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox