sh1.sh sh2.sh"
tests_no=`expr 0`
+# Directory must be owned by bin
+[ "$USER" != root ] || chown bin .
+
+# Count tests
for i in `echo $tests`; do
if [ -x ./test$i ]; then
tests_no=`expr $tests_no + 1`
then
total=`expr $total + 1`
FAIL=0
- if [ $USER = root -a \( $i = 11 -o $i = 33 \) ]
- then su - ast -c "cd `pwd`; ./test$i" || FAIL=1
+ if [ "$USER" = root ]
+ then su - bin -c "cd `pwd`; ./test$i" || FAIL=1
else ./test$i || FAIL=1
fi
if [ $FAIL -eq 0 ]
}
sync();
- if (geteuid() == 0 || getuid() == 0) {
- realpath(argv[0], buffer);
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
- printf("Test 17 cannot run as root; test aborted\n");
- exit(1);
- }
#define DIR "DIR17"
system("rm -rf " DIR);
}
}
- if (geteuid() == 0 || getuid() == 0) {
- realpath(argv[0], buffer);
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
- printf("Test 18 cannot run as root; test aborted\n");
- exit(1);
- }
-
#define DIR "DIR18"
system("rm -rf " DIR);
if(mkdir(DIR, 0755) != 0) {
m = (argc == 2 ? atoi(argv[1]) : 0xFFFF);
- if (geteuid() == 0 || getuid() == 0) {
- realpath(argv[0], buffer);
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
- printf("Test 19 cannot run as root; test aborted\n");
- exit(1);
- }
-
system("rm -rf DIR_19; mkdir DIR_19");
chdir("DIR_19");
int i, m = 0xFFFF;
sync();
- if (geteuid() == 0 || getuid() == 0) {
- realpath(argv[0], buffer);
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
- printf("Test 21 cannot run as root; test aborted\n");
- exit(1);
- }
if (argc == 2) m = atoi(argv[1]);
printf("Test 21 ");
int i, m = 0xFFFF;
sync();
- if (geteuid() == 0 || getuid() == 0) {
- realpath(argv[0], buffer);
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
- printf("Test 25 cannot run as root; test aborted\n");
- exit(1);
- }
if (argc == 2) m = atoi(argv[1]);
start(25);
sync();
- if (geteuid() == 0 || getuid() == 0) {
- realpath(argv[0], buffer);
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
- printf("Test 3 cannot run as root; test aborted\n");
- exit(1);
- }
if (argc == 2) m = atoi(argv[1]);
int i, m = 0xFFFF;
sync();
- if (geteuid() == 0 || getuid() == 0) {
- realpath(argv[0], buffer);
- execl("/usr/bin/su", "/usr/bin/su", "-", "ast", "-c", buffer, NULL);
- printf("Test 6 cannot run as root; test aborted\n");
- exit(1);
- }
if (argc == 2) m = atoi(argv[1]);