#!/bin/sh

. ./test-functions

echo -n "Utime taints			"
# Create file now; creating after taint would taint parent directory.
file=$(mktemp sft-XXXXXX)
( # Sub-shell so as not to taint the test process.
	IGNORE=$(cat confidential)
	sleep 1
	touch $file # Call utime after becoming tainted.
	value=$(getfattr --only-values -n security.simple-flow.confidential $file 2> /dev/null)
	if [ x$value = xtrue ]; then
                exit 0
        else
                exit 1
        fi
)
if [ $? != 0 ]; then
        failmsg did not mark confidential
else
	passmsg marked confidential
fi
rm -f $file
