TESTROOT = ../..
include ${TESTROOT}/include/common.makefile
+PWD = $(shell pwd)
#
# a setuid main executable linked with -rpath links against a dylib
# LC_RPATH uses @loader_path or a relative path, but ok if it is an absolute path
#
+all-check: all check
-run: all
+check:
./main || echo "FAIL rpath-indirect-suid absolute path"
${TESTROOT}/bin/exit-non-zero-pass.pl "rpath-indirect-suid @loader_path path" "rpath-indirect-suid @loader_path path" ./main_bad1
${TESTROOT}/bin/exit-non-zero-pass.pl "rpath-indirect-suid relative path" "rpath-indirect-suid relative path" ./main_bad2
${CC} bar.c -dynamiclib -o hide/hole/libbar.dylib -install_name @rpath/libbar.dylib
libfoo.dylib : foo.c hide/hole/libbar.dylib
- ${CC} foo.c -dynamiclib -o "`pwd`/libfoo.dylib" hide/hole/libbar.dylib
+ ${CC} foo.c -dynamiclib -o "${PWD}/libfoo.dylib" hide/hole/libbar.dylib
main : main.c libfoo.dylib
- ${CC} -I${TESTROOT}/include main.c -o main libfoo.dylib -Wl,-rpath -Wl,`pwd`/hide/hole
+ ${CC} -I${TESTROOT}/include main.c -o main libfoo.dylib -Wl,-rpath -Wl,${PWD}/hide/hole
sudo chown root main
sudo chmod 4755 main