source: trunk/base/tests/trace/Makefile @ 19004

Last change on this file since 19004 was 19004, checked in by pguyot (Paul Guyot), 14 years ago

Changes to strengthen the trace mode:

  • the values of the global variables are noted when the library is loaded and not when the first trapped function is called.
  • when a process calls exec[ve], the environment variables are restored.

Both changes aim at preventing processes to (inadvertantly) bypass of trace
mode.

Several holes remain (syscall, setuid binaries owned by a different user, kernel
modules), but this should prevent all inadvertant methods to bypass the trace
mode.

  • Property svn:eol-style set to native
File size: 806 bytes
Line 
1include ../../Mk/dports.autoconf.mk
2
3.PHONY: test
4
5$(bindir)/port:
6        @echo "Please install DarwinPorts before running this test"
7        @exit 1
8       
9test:
10        @PORTSRC=$(PORTSRC) $(bindir)/port clean > /dev/null
11        @touch delete-trace
12        @touch rename-trace
13        @mkdir -p rmdir-trace
14        @rm -f create-trace
15        @rm -f create-trace-modenv
16        @rm -rf mkdir-trace
17        @rm -f /tmp/hello-trace
18        @PORTSRC=$(PORTSRC) $(bindir)/port -t test > output 2>&1 || (cat output; exit 1)
19        @rm -f delete-trace
20        @rm -f rename-trace
21        @rm -f rename-new-trace
22        @rm -f create-trace
23        @rm -f create-trace-modenv
24        @rm -rf mkdir-trace
25        @rm -rf rmdir-trace
26        @rm -f /tmp/hello-trace
27        @sed -e "s|${PWD}|PWD|g" < output > output.sed
28        @diff output.sed master 2>&1 | tee difference
29        @if [ -s difference ]; then \
30                exit 1; \
31        else \
32                rm -f difference output.sed; \
33        fi
Note: See TracBrowser for help on using the repository browser.