]> git.saurik.com Git - apple/dyld.git/blobdiff - unit-tests/test-cases/suid-executable_path/Makefile
dyld-851.27.tar.gz
[apple/dyld.git] / unit-tests / test-cases / suid-executable_path / Makefile
index 1dd7f1ebaf7d0ec664c26e665434983162c02778..aab4ca27fd4f1655d5db88f41ad8914c3f4be8cf 100644 (file)
 # 
 # @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
 
+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
@@ -32,13 +38,15 @@ SHELL = bash # use bash shell so we can redirect just stderr
 # Use of relative paths in setuid binaries is not allowed
 #
 
-run: all
+all-check: all check
+
+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" 
-       ${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" 
-       ${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