]> git.saurik.com Git - apple/dyld.git/blobdiff - unit-tests/test-cases/suid-executable_path/Makefile
dyld-195.5.tar.gz
[apple/dyld.git] / unit-tests / test-cases / suid-executable_path / Makefile
index 87690821a9fffc635473ab4bdbcc55c881a2a797..aab4ca27fd4f1655d5db88f41ad8914c3f4be8cf 100644 (file)
 # 
 # @APPLE_LICENSE_HEADER_END@
 ##
 # 
 # @APPLE_LICENSE_HEADER_END@
 ##
-TESTROOT = ../..
+PWD = $(shell pwd)
+TESTROOT = $(PWD)/../..
 include ${TESTROOT}/include/common.makefile
 
 SHELL = bash # use bash shell so we can redirect just stderr
 
 include ${TESTROOT}/include/common.makefile
 
 SHELL = bash # use bash shell so we can redirect just stderr
 
+ifeq "$(OS_NAME)" "iPhoneOS"
+       RUN_AS_USER = login -f -l mobile
+else
+       RUN_AS_USER = 
+endif
 
 #
 # Use of @exectuable_path in setuid binaries is not allowed
 
 #
 # Use of @exectuable_path in setuid binaries is not allowed
@@ -36,11 +42,11 @@ all-check: all check
 
 check:
        ./main_exe "setuid-executable_path" || echo "FAIL setuid-executable_path @executable_path not setuid"
 
 check:
        ./main_exe "setuid-executable_path" || echo "FAIL setuid-executable_path @executable_path not setuid"
-       ${TESTROOT}/bin/exit-non-zero-pass.pl "setuid-executable_path @executable_path" "setuid-executable_path @executable_path" ./main_exe-suid "setuid-executable_path"
        ./main_loader "setuid-executable_path" || echo "FAIL setuid-executable_path @loader_path not setuid" 
        ./main_loader "setuid-executable_path" || echo "FAIL setuid-executable_path @loader_path not setuid" 
-       ${TESTROOT}/bin/exit-non-zero-pass.pl "setuid-executable_path @loader_path" "setuid-executable_path @loader_path" ./main_loader-suid "setuid-executable_path"
        ./main_rel "setuid-executable_path" || echo "FAIL setuid-executable_path relative path not setuid" 
        ./main_rel "setuid-executable_path" || echo "FAIL setuid-executable_path relative path not setuid" 
-       ${TESTROOT}/bin/exit-non-zero-pass.pl "setuid-executable_path relative path" "setuid-executable_path relative path" ./main_rel-suid "setuid-executable_path"
+       ${RUN_AS_USER} ${PASS_IFF_FAILURE} "setuid-executable_path @executable_path" "setuid-executable_path @executable_path" $(PWD)/main_exe-suid
+       ${RUN_AS_USER} ${PASS_IFF_FAILURE} "setuid-executable_path @loader_path" "setuid-executable_path @loader_path" $(PWD)/main_loader-suid
+       ${RUN_AS_USER} ${PASS_IFF_FAILURE} "setuid-executable_path relative path" "setuid-executable_path relative path" $(PWD)/main_rel-suid