#!/bin/sh

. ./test-functions

echo -n "Tainted later shared memory test:	"
( # Sub-shell so as not to taint the test process.
	_wget=$(copy wget)
	ipcrm -a
	# Attach, sleep 3, and then read (attach before shm tainted).
	./programs/shmread 1 3 | test_evil_bit $_wget --no-check-certificate -i - --quiet -O /dev/null &
	# Give time to attach.
	sleep 1
	./programs/shmwrite 1 `cat confidential` 0
	wait
	ipcrm -a
	rm -f $_wget
)
