Signed-off-by: Zeng Linggang <zenglg...@cn.fujitsu.com> --- testcases/kernel/security/smack/.gitignore | 2 +- testcases/kernel/security/smack/notroot.c | 29 ---------------------- .../kernel/security/smack/smack_file_access.sh | 2 +- testcases/kernel/security/smack/smack_notroot.c | 29 ++++++++++++++++++++++ 4 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 testcases/kernel/security/smack/notroot.c create mode 100644 testcases/kernel/security/smack/smack_notroot.c
diff --git a/testcases/kernel/security/smack/.gitignore b/testcases/kernel/security/smack/.gitignore index 5e9e819..16d5663 100644 --- a/testcases/kernel/security/smack/.gitignore +++ b/testcases/kernel/security/smack/.gitignore @@ -1,2 +1,2 @@ -/notroot +/smack_notroot /smack_set_socket_labels diff --git a/testcases/kernel/security/smack/notroot.c b/testcases/kernel/security/smack/notroot.c deleted file mode 100644 index 05858d3..0000000 --- a/testcases/kernel/security/smack/notroot.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (C) 2007 Casey Schaufler <ca...@schaufler-ca.com> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, version 2. - * - * Author: - * Casey Schaufler <ca...@schaufler-ca.com> - */ - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> - -int main(int argc, char *argv[]) -{ - setuid(1); - - execv(argv[1], &argv[1]); - - perror(argv[0]); - exit(1); -} diff --git a/testcases/kernel/security/smack/smack_file_access.sh b/testcases/kernel/security/smack/smack_file_access.sh index a2d09c0..8642715 100755 --- a/testcases/kernel/security/smack/smack_file_access.sh +++ b/testcases/kernel/security/smack/smack_file_access.sh @@ -37,7 +37,7 @@ TST_CLEANUP=cleanup chmod 777 $(pwd) -notroot /bin/sh -c "echo InitialData 2>/tmp/smack_fail.log > $testfile" +smack_notroot /bin/sh -c "echo InitialData 2>/tmp/smack_fail.log > $testfile" if [ ! -f "$testfile" ]; then tst_brkm TFAIL "Test file \"$testfile\" can not be created." fi diff --git a/testcases/kernel/security/smack/smack_notroot.c b/testcases/kernel/security/smack/smack_notroot.c new file mode 100644 index 0000000..05858d3 --- /dev/null +++ b/testcases/kernel/security/smack/smack_notroot.c @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2007 Casey Schaufler <ca...@schaufler-ca.com> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, version 2. + * + * Author: + * Casey Schaufler <ca...@schaufler-ca.com> + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> + +int main(int argc, char *argv[]) +{ + setuid(1); + + execv(argv[1], &argv[1]); + + perror(argv[0]); + exit(1); +} -- 1.9.3 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list